Commit Graph

29 Commits

Author SHA1 Message Date
Raff Tsai
3c337d5659 Fix robolectric test error
Fixes: 132575837
Test: make RunSettingsRoboTests
Change-Id: I5238a3789f5308a489298fadae772b8b9343ddb5
2019-05-13 16:56:05 +08:00
Lei Yu
9bc3273489 Update datausage for DataUsagePreferenceController
Data usage number was wrong because we didn't set correct
subId, this CL fixes this issue.

Bug: 132113657
Test: RunSettingsRoboTests
Change-Id: If7c9cf2f4709d9a8e5f9a154c02de9484800d6d5
2019-05-08 10:25:10 -07:00
Doris Ling
9c2556da09 Query correct subscription id for mobile data.
- On the Data usage settings page, we check for valid subscription id to
determine if we should show the mobile section. However, we are querying
the default subscription id, which will return the 1st id for any
subscription if there's no data subscription. Since this is for mobile
section, we should query the default data subscription id explicitly.

Change-Id: I08c80639d07477e486a2d9a10761e11df4c73b28
Fixes: 119881046
Test: make RunSettingsRoboTests
2019-01-24 14:21:18 -08:00
James Lemieux
f1dade40d2 Use binary resource support in robolectric
The resources available to tests are now exactly the merged resources
located in the APK under test.

Bug: 74359828
Test: make -j56 RunSettingsRoboTests
Change-Id: I050db81a92decefea23314b5ec7a62f77ff4bb2b
2018-12-12 19:53:49 -08:00
TreeHugger Robot
3673833417 Merge "Prepare tests for impending robolectric merge" 2018-11-20 17:49:57 +00:00
James Lemieux
1fc96ea98d Prepare tests for impending robolectric merge
Setting's ShadowUserManager.reset() was unnecessary and collided with a
newly introduced reset() method in its super class. It has been removed.

Test: make -j56 RunSettingsGoogleRoboTests &&
  make -j56 RunSettingsRoboTests &&
  make -j56 RunSettingsLibRoboTests

Change-Id: I63c50eca0de3581fd4f64f4862233446f5937d0c
2018-11-19 16:56:40 -08:00
Doris Ling
ac00f2cb76 Fix data usage failing test.
- update the tests that faile when data usage v2 is turned on.

Change-Id: I6bd09245d695791fb1564b6e598600e889d0712f
Fixes: 117433810
Test: make RunSettingsRoboTests
2018-11-16 13:06:37 -08:00
Fan Zhang
cdf284b732 Make Settings robotest work with tot Robolectric
Bug: 116278591
Test: make -j RunSettingsRoboTests
Change-Id: I32cb2fcf6094675f79d2fc24702ef6298a9691e4
2018-10-31 17:59:17 -07:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
tmfang
f12e6adcdc Settings Fragment Migration (Fix test cases)
Fix all Roboletric test cases.
In this CL, some test cases are broken.
So, We ignored these test cases temporarily.

Test: make RunSettingsRoboTests -j56
Bug: 110259478
Change-Id: I1a3075438a614432a2de4f2d96d8abf9a83ce58c
2018-07-11 18:24:51 -07:00
Fan Zhang
289677f97f Switch from SI to IEC unit when formatting data usage bytes
- Created a new helper method DataUsageUtils.formatDataUsage() to
  format data usage bytes using IEC formatting.
- Switch from Formatter.formatFileSize() to DataUsageUtils.formatDataUsage()
  everywhere in datausage package.

Change-Id: I9323beed8bf5126b153fc9a3cdd9591c97ca6fd2
Bug: 76159924
Test: robotests
2018-04-12 09:52:35 -07:00
Jan Nordqvist
9eb43ddddf Fall back to Wi-Fi data display in data usage screen with no SIM.
Bug: 70950124

Test: manual
Test: make RunSettingsRoboTests
Change-Id: I06bf78e54119819be87e15baca7e5b6a241958cb
2018-04-05 07:58:23 -07:00
Jan Nordqvist
637dc29fe9 In Network & internet screen, hide summary under Data usage when there is No SIM
Bug: 70950124

Test: manual
Test: make RunSettingsRoboTests
Change-Id: I4abd401aa9420b2b0090fac76991fe5067acc2e9
2018-03-16 14:29:33 -07:00
James Lemieux
22a39c2b93 Use external/robolectric-shadows/run_robotests.mk
This allows Settings to test against the latest framework changes.

Also replaced TestConfig with traditional robolectric.properties.

Bug: 73173204
Bug: 73892008
Test: make -j56 RunSettingsRoboTests
Change-Id: I3135b4fa5f095ba79b282a76f45dd9baa2584bc7
2018-03-04 03:50:08 -08:00
jackqdyulei
261c29c485 Add wifi metered controls in wifi settings.
1. Add it in wifi detail page
2. Add it in wifi dialog
2. Remove it in "Mobile network" page

Bug: 68030417
Test: RunSettingsRoboTests
Change-Id: I2e001c55f3c6c75a660e429732dfbece97b0ca9e
2018-01-09 12:44:51 -08:00
jeffreyhuang
cbfb099a40 Rename SDK_VERSION_O to SDK_VERSION
Test: make RunSettingsRoboTests -j40
Change-Id: I6715062d8addadda441e32809db1af55f15e3a90
2017-12-05 16:43:54 -08:00
jeffreyhuang
d816465bb3 Move datausage test package to sdk 26
Test: make RunSettingsRoboTests -j40
Change-Id: I10d2d0eb9abafe8a81adab3ce3f5db2f1f3337b8
2017-11-27 16:46:52 -08:00
Fan Zhang
cbc4218b9b Format data usage and data limit consistently.
The usage formatter's format flag is change to match data limt flag.

Change-Id: I37d3c8c7bc67a918c793f4799e060010d269834d
Fixes: 63581756
Test: robotests
2017-10-11 15:01:10 -07:00
Maurice Lam
e18902ec67 Update Robolectric to 3.4.2
Bug: 66693279
Test: m RunSettingsRoboTests
      m RunSettingsRoboTests-jacoco
Change-Id: I9df619c3d68f0af2ee2ae944a15998275129f7c2
2017-09-22 18:34:00 +00:00
Matthew Fritze
621c24861c Fix DataUsageSummary non-indexable keys
Indexing in DataUsage was not conventional, since it
blocked adding XML based on current sim status rather than
indexing everything and changing non-indexabe keys.

Manual merge for: ag/2631595

Change-Id: I7bb3cdb0f11772bbaefb6c21c61eb63bd0b17c7e
Fixes: 64193449
Test: robotests
2017-07-31 14:20:31 -07:00
Rajeev Kumar
9664c1a55e Refactor few public static methods.
Move public static methods from DataUsageSummary to DataUsageBase.

Bug: 62349208
Test: make RunSettingsRoboTests -j40
Change-Id: I632f75f4c4f370fb225a9787267043fec20994e5
2017-07-14 14:01:02 -07:00
Jeff Sharkey
dc09269c81 Move "metered" persistence to WifiConfiguration.
For a long time we've had a nasty tangled dependency between Wi-Fi
and NPMS, since they both persisted different details for configured
networks.  As part of preparing for new carrier data plan APIs, move
the tracking of meteredness over to WifiConfiguration.

We've never really supported "unmetered" mobile networks inside the
framework, so remove the option to configure those flags.

Replace MeteredPreference.notifyChanged() with explicit listener
to avoid confusing an invalidation pass as expression of user intent
to change metered values.

Bug: 63391323
Test: builds, boots, Wi-Fi policy is upgraded
Exempt-From-Owner-Approval: No owner was found for changed files.
Change-Id: If8a6e12650d1d060a729ed1a80f07ebb65e0ffd7
2017-07-14 09:47:03 -06:00
Andrew Sapperstein
9f1e911759 Refactor test runner to use static list of resource paths
Previously everything lived in an inner class method of
SettingsRobolectricTestRunner. That method has now been turned into
a static method so that it can be called by other runners.

Bug: 62460102
Test: robotests
Change-Id: I6612b1f26404587301c534c8ba60e39d59d6c840
2017-06-09 09:21:26 -07:00
Matthew Fritze
8b0ed39c11 Remove Network Restrictions duplicate from setting search
Bug: 33701673
Test: make RunSettingsRoboTests
Change-Id: I6b1aef6102811a6ad25d2da43993441c6e56006c
2017-05-16 14:35:19 -07:00
Matthew Fritze
2caaa7420d Remove search duplicates for Wifi and Bluetooth
Remove the master switch duplicates between the switch
and their targets. Only show the actual Wifi and Bluetooth
settings as search results.

Bug: 33701673
Test: make RunSettingsRoboTests
Change-Id: I226cc8db40a308bd9bcfacdd4fc6ae709fb809c5
2017-04-27 12:36:16 -07:00
Doris Ling
47ec3857a5 Update preference text for Network & internet screen.
- Add footer info to Hotspot & tethering
- Add summary text for Data usage -> Network restrictions
- Update summary for Hotspot & tethering -> Portable Wi-Fi hotspot
- Remove quotes from Wi-Fi summary

Bug: 36296257
Test: make RunSettingsRoboTests

Change-Id: Ibab61b089521a3339e660e9df0db0cd1b316712b
2017-03-21 18:00:59 -07:00
Salvador Martinez
f86905ed50 Modified settings tests to use custom test runner
The custom test runner lets us use resources from
multiple projects which resolves many ResourceNotFound
errors that would come up when people who made changes
wrote tests.

Test: make RunSettingsRoboTests
Bug: 32180625
Change-Id: I71f30eecc1164b117351a74b3ea0533625feae5b
2016-10-25 17:20:20 -07:00
Matthew Fritze
9a3dc4e2a8 Update Robolectric tests to use google truth
Bug: 31545801
Test: make RunSettingsRoboTests
Change-Id: Idb801d51b6a4dc02ea062bc32086e1a8fc28b94b
2016-09-19 11:42:11 -07:00
Matthew Fritze
626a21b0bf Add Robolectric makefile and modify Settings Manifest for testing.
Bug: 30918570
Change-Id: I4ae998676757b4985833fac5ba05d7685e29a8a8
2016-08-17 23:28:38 +00:00