summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/tests
diff options
context:
space:
mode:
authorJason Monk <jmonk@google.com>2014-12-12 18:56:18 +0000
committerandroid-build-merger <android-build-merger@google.com>2014-12-12 18:56:18 +0000
commit0adc69032db5ccb62bd731ed526272fc6ded3b90 (patch)
tree2879ce442b2922364c9b1e0e832fe420148a330f /packages/SystemUI/tests
parent7f8fab6fc3c5e8f5d7b0a7813a6db5ca682e8a7a (diff)
parent89b75bdbf64416cfea39641a85bf6458212a32bf (diff)
downloadframeworks_base-0adc69032db5ccb62bd731ed526272fc6ded3b90.zip
frameworks_base-0adc69032db5ccb62bd731ed526272fc6ded3b90.tar.gz
frameworks_base-0adc69032db5ccb62bd731ed526272fc6ded3b90.tar.bz2
am f8dd5f6a: am a47f968d: Merge "Handle config changes in NetworkController" into lmp-mr1-dev
automerge: 89b75bd * commit '89b75bdbf64416cfea39641a85bf6458212a32bf': Handle config changes in NetworkController
Diffstat (limited to 'packages/SystemUI/tests')
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerDataTest.java38
1 files changed, 34 insertions, 4 deletions
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerDataTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerDataTest.java
index e327233..3f9312d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerDataTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerDataTest.java
@@ -1,9 +1,9 @@
package com.android.systemui.statusbar.policy;
+import org.mockito.Mockito;
+
import android.telephony.TelephonyManager;
-// WARNING: Many of these tests may fail with config showMin3G.
-// TODO: Maybe fix the above.
public class NetworkControllerDataTest extends NetworkControllerBaseTest {
public void test3gDataIcon() {
@@ -57,7 +57,6 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest {
updateDataConnectionState(TelephonyManager.DATA_CONNECTED,
TelephonyManager.NETWORK_TYPE_LTE);
- // WARNING: May fail depending on config.
verifyDataIndicators(TelephonyIcons.DATA_LTE[1][0 /* No direction */],
TelephonyIcons.QS_DATA_LTE[1]);
}
@@ -67,11 +66,42 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest {
updateDataConnectionState(TelephonyManager.DATA_CONNECTED,
TelephonyManager.NETWORK_TYPE_HSPA);
- // WARNING: May fail depending on config.
verifyDataIndicators(TelephonyIcons.DATA_H[1][0 /* No direction */],
TelephonyIcons.QS_DATA_H[1]);
}
+ public void test4gDataIcon() {
+ // Switch to showing 4g icon and re-initialize the NetworkController.
+ mConfig.show4gForLte = true;
+ mNetworkController = new NetworkControllerImpl(mContext, mMockCm, mMockTm, mMockWm, mMockSm,
+ mConfig, Mockito.mock(AccessPointControllerImpl.class),
+ Mockito.mock(MobileDataControllerImpl.class));
+ setupNetworkController();
+
+ setupDefaultSignal();
+ updateDataConnectionState(TelephonyManager.DATA_CONNECTED,
+ TelephonyManager.NETWORK_TYPE_LTE);
+
+ verifyDataIndicators(TelephonyIcons.DATA_4G[1][0 /* No direction */],
+ TelephonyIcons.QS_DATA_4G[1]);
+ }
+
+ public void test4gDataIconConfigChange() {
+ setupDefaultSignal();
+ updateDataConnectionState(TelephonyManager.DATA_CONNECTED,
+ TelephonyManager.NETWORK_TYPE_LTE);
+
+ // Switch to showing 4g icon and re-initialize the NetworkController.
+ mConfig.show4gForLte = true;
+ // Can't send the broadcast as that would actually read the config from
+ // the context. Instead we'll just poke at a function that does all of
+ // the after work.
+ mNetworkController.handleConfigurationChanged();
+
+ verifyDataIndicators(TelephonyIcons.DATA_4G[1][0 /* No direction */],
+ TelephonyIcons.QS_DATA_4G[1]);
+ }
+
public void testDataActivity() {
setupDefaultSignal();