Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerDataTest.java +13 −1 Original line number Original line Diff line number Diff line Loading @@ -18,10 +18,10 @@ import org.junit.runner.RunWith; @SmallTest @SmallTest @RunWith(AndroidJUnit4.class) @RunWith(AndroidJUnit4.class) @Ignore("Flaky") public class NetworkControllerDataTest extends NetworkControllerBaseTest { public class NetworkControllerDataTest extends NetworkControllerBaseTest { @Test @Test @Ignore("Flaky") public void test3gDataIcon() { public void test3gDataIcon() { setupDefaultSignal(); setupDefaultSignal(); Loading @@ -30,6 +30,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void test2gDataIcon() { public void test2gDataIcon() { setupDefaultSignal(); setupDefaultSignal(); updateDataConnectionState(TelephonyManager.DATA_CONNECTED, updateDataConnectionState(TelephonyManager.DATA_CONNECTED, Loading @@ -40,6 +41,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testCdmaDataIcon() { public void testCdmaDataIcon() { setupDefaultSignal(); setupDefaultSignal(); updateDataConnectionState(TelephonyManager.DATA_CONNECTED, updateDataConnectionState(TelephonyManager.DATA_CONNECTED, Loading @@ -50,6 +52,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testEdgeDataIcon() { public void testEdgeDataIcon() { setupDefaultSignal(); setupDefaultSignal(); updateDataConnectionState(TelephonyManager.DATA_CONNECTED, updateDataConnectionState(TelephonyManager.DATA_CONNECTED, Loading @@ -60,6 +63,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testLteDataIcon() { public void testLteDataIcon() { setupDefaultSignal(); setupDefaultSignal(); updateDataConnectionState(TelephonyManager.DATA_CONNECTED, updateDataConnectionState(TelephonyManager.DATA_CONNECTED, Loading @@ -70,6 +74,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testHspaDataIcon() { public void testHspaDataIcon() { setupDefaultSignal(); setupDefaultSignal(); updateDataConnectionState(TelephonyManager.DATA_CONNECTED, updateDataConnectionState(TelephonyManager.DATA_CONNECTED, Loading @@ -80,6 +85,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testWfcNoDataIcon() { public void testWfcNoDataIcon() { setupDefaultSignal(); setupDefaultSignal(); updateDataConnectionState(TelephonyManager.DATA_CONNECTED, updateDataConnectionState(TelephonyManager.DATA_CONNECTED, Loading @@ -89,6 +95,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void test4gDataIcon() { public void test4gDataIcon() { // Switch to showing 4g icon and re-initialize the NetworkController. // Switch to showing 4g icon and re-initialize the NetworkController. mConfig.show4gForLte = true; mConfig.show4gForLte = true; Loading @@ -108,6 +115,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testDataDisabledIcon() { public void testDataDisabledIcon() { setupNetworkController(); setupNetworkController(); when(mMockTm.getDataEnabled(mSubId)).thenReturn(false); when(mMockTm.getDataEnabled(mSubId)).thenReturn(false); Loading @@ -120,6 +128,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testDataDisabledIcon_UserNotSetup() { public void testDataDisabledIcon_UserNotSetup() { setupNetworkController(); setupNetworkController(); when(mMockTm.getDataEnabled(mSubId)).thenReturn(false); when(mMockTm.getDataEnabled(mSubId)).thenReturn(false); Loading @@ -134,6 +143,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void test4gDataIconConfigChange() { public void test4gDataIconConfigChange() { setupDefaultSignal(); setupDefaultSignal(); updateDataConnectionState(TelephonyManager.DATA_CONNECTED, updateDataConnectionState(TelephonyManager.DATA_CONNECTED, Loading @@ -151,6 +161,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testDataChangeWithoutConnectionState() { public void testDataChangeWithoutConnectionState() { setupDefaultSignal(); setupDefaultSignal(); updateDataConnectionState(TelephonyManager.DATA_CONNECTED, updateDataConnectionState(TelephonyManager.DATA_CONNECTED, Loading @@ -167,6 +178,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testDataActivity() { public void testDataActivity() { setupDefaultSignal(); setupDefaultSignal(); Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java +29 −1 Original line number Original line Diff line number Diff line Loading @@ -48,10 +48,10 @@ import static org.mockito.Mockito.mock; @SmallTest @SmallTest @RunWith(AndroidJUnit4.class) @RunWith(AndroidJUnit4.class) @Ignore("Flaky") public class NetworkControllerSignalTest extends NetworkControllerBaseTest { public class NetworkControllerSignalTest extends NetworkControllerBaseTest { @Test @Test @Ignore("Flaky") public void testNoIconWithoutMobile() { public void testNoIconWithoutMobile() { // Turn off mobile network support. // Turn off mobile network support. Mockito.when(mMockCm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE)).thenReturn(false); Mockito.when(mMockCm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE)).thenReturn(false); Loading @@ -66,6 +66,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testNoSimsIconPresent() { public void testNoSimsIconPresent() { // No Subscriptions. // No Subscriptions. mNetworkController.mMobileSignalControllers.clear(); mNetworkController.mMobileSignalControllers.clear(); Loading @@ -75,6 +76,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testEmergencyOnly() { public void testEmergencyOnly() { setupDefaultSignal(); setupDefaultSignal(); mNetworkController.recalculateEmergency(); mNetworkController.recalculateEmergency(); Loading @@ -86,6 +88,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testEmergencyOnlyNoSubscriptions() { public void testEmergencyOnlyNoSubscriptions() { setupDefaultSignal(); setupDefaultSignal(); setSubscriptions(); setSubscriptions(); Loading @@ -96,6 +99,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testNoEmergencyOnlyWrongSubscription() { public void testNoEmergencyOnlyWrongSubscription() { setupDefaultSignal(); setupDefaultSignal(); setDefaultSubId(42); setDefaultSubId(42); Loading @@ -104,6 +108,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testNoEmengencyNoSubscriptions() { public void testNoEmengencyNoSubscriptions() { setupDefaultSignal(); setupDefaultSignal(); setSubscriptions(); setSubscriptions(); Loading @@ -114,6 +119,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testNoSimlessIconWithoutMobile() { public void testNoSimlessIconWithoutMobile() { // Turn off mobile network support. // Turn off mobile network support. Mockito.when(mMockCm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE)).thenReturn(false); Mockito.when(mMockCm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE)).thenReturn(false); Loading @@ -132,6 +138,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testSignalStrength() { public void testSignalStrength() { for (int testStrength = 0; for (int testStrength = 0; testStrength < SignalStrength.NUM_SIGNAL_STRENGTH_BINS; testStrength++) { testStrength < SignalStrength.NUM_SIGNAL_STRENGTH_BINS; testStrength++) { Loading @@ -149,6 +156,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testCdmaSignalStrength() { public void testCdmaSignalStrength() { for (int testStrength = 0; for (int testStrength = 0; testStrength < SignalStrength.NUM_SIGNAL_STRENGTH_BINS; testStrength++) { testStrength < SignalStrength.NUM_SIGNAL_STRENGTH_BINS; testStrength++) { Loading @@ -163,6 +171,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testSignalRoaming() { public void testSignalRoaming() { for (int testStrength = 0; for (int testStrength = 0; testStrength < SignalStrength.NUM_SIGNAL_STRENGTH_BINS; testStrength++) { testStrength < SignalStrength.NUM_SIGNAL_STRENGTH_BINS; testStrength++) { Loading @@ -177,6 +186,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testCdmaSignalRoaming() { public void testCdmaSignalRoaming() { for (int testStrength = SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN; for (int testStrength = SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN; testStrength <= SignalStrength.SIGNAL_STRENGTH_GREAT; testStrength++) { testStrength <= SignalStrength.SIGNAL_STRENGTH_GREAT; testStrength++) { Loading @@ -192,6 +202,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testQsSignalStrength() { public void testQsSignalStrength() { for (int testStrength = SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN; for (int testStrength = SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN; testStrength <= SignalStrength.SIGNAL_STRENGTH_GREAT; testStrength++) { testStrength <= SignalStrength.SIGNAL_STRENGTH_GREAT; testStrength++) { Loading @@ -205,6 +216,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testCdmaQsSignalStrength() { public void testCdmaQsSignalStrength() { for (int testStrength = SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN; for (int testStrength = SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN; testStrength <= SignalStrength.SIGNAL_STRENGTH_GREAT; testStrength++) { testStrength <= SignalStrength.SIGNAL_STRENGTH_GREAT; testStrength++) { Loading @@ -219,6 +231,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testNoBangWithWifi() { public void testNoBangWithWifi() { setupDefaultSignal(); setupDefaultSignal(); setConnectivity(mMobileSignalController.mTransportType, false, false); setConnectivity(mMobileSignalController.mTransportType, false, false); Loading @@ -230,6 +243,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { // Some tests of actual NetworkController code, just internals not display stuff // Some tests of actual NetworkController code, just internals not display stuff // TODO: Put this somewhere else, maybe in its own file. // TODO: Put this somewhere else, maybe in its own file. @Test @Test @Ignore("Flaky") public void testHasCorrectMobileControllers() { public void testHasCorrectMobileControllers() { int[] testSubscriptions = new int[] { 1, 5, 3 }; int[] testSubscriptions = new int[] { 1, 5, 3 }; int notTestSubscription = 0; int notTestSubscription = 0; Loading Loading @@ -257,6 +271,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testSetCurrentSubscriptions() { public void testSetCurrentSubscriptions() { // We will not add one controller to make sure it gets created. // We will not add one controller to make sure it gets created. int indexToSkipController = 0; int indexToSkipController = 0; Loading Loading @@ -310,6 +325,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testHistorySize() { public void testHistorySize() { // Verify valid history size, otherwise it gits printed out the wrong order and whatnot. // Verify valid history size, otherwise it gits printed out the wrong order and whatnot. assertEquals(0, SignalController.HISTORY_SIZE & (SignalController.HISTORY_SIZE - 1)); assertEquals(0, SignalController.HISTORY_SIZE & (SignalController.HISTORY_SIZE - 1)); Loading @@ -323,6 +339,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testOnReceive_stringsUpdatedAction_spn() { public void testOnReceive_stringsUpdatedAction_spn() { String expectedMNetworkName = "Test"; String expectedMNetworkName = "Test"; Intent intent = createStringsUpdatedIntent(true /* showSpn */, Intent intent = createStringsUpdatedIntent(true /* showSpn */, Loading @@ -336,6 +353,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testOnReceive_stringsUpdatedAction_plmn() { public void testOnReceive_stringsUpdatedAction_plmn() { String expectedMNetworkName = "Test"; String expectedMNetworkName = "Test"; Loading @@ -350,6 +368,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testOnReceive_stringsUpdatedAction_bothFalse() { public void testOnReceive_stringsUpdatedAction_bothFalse() { Intent intent = createStringsUpdatedIntent(false /* showSpn */, Intent intent = createStringsUpdatedIntent(false /* showSpn */, "Irrelevant" /* spn */, "Irrelevant" /* spn */, Loading @@ -365,6 +384,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testOnReceive_stringsUpdatedAction_bothTrueAndNull() { public void testOnReceive_stringsUpdatedAction_bothTrueAndNull() { Intent intent = createStringsUpdatedIntent(true /* showSpn */, Intent intent = createStringsUpdatedIntent(true /* showSpn */, null /* spn */, null /* spn */, Loading @@ -379,6 +399,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testOnReceive_stringsUpdatedAction_bothTrueAndNonNull() { public void testOnReceive_stringsUpdatedAction_bothTrueAndNonNull() { String spn = "Test1"; String spn = "Test1"; String plmn = "Test2"; String plmn = "Test2"; Loading Loading @@ -413,6 +434,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testOnUpdateDataActivity_dataIn() { public void testOnUpdateDataActivity_dataIn() { setupDefaultSignal(); setupDefaultSignal(); Loading @@ -427,6 +449,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testOnUpdateDataActivity_dataOut() { public void testOnUpdateDataActivity_dataOut() { setupDefaultSignal(); setupDefaultSignal(); Loading @@ -440,6 +463,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testOnUpdateDataActivity_dataInOut() { public void testOnUpdateDataActivity_dataInOut() { setupDefaultSignal(); setupDefaultSignal(); Loading @@ -454,6 +478,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testOnUpdateDataActivity_dataActivityNone() { public void testOnUpdateDataActivity_dataActivityNone() { setupDefaultSignal(); setupDefaultSignal(); Loading @@ -468,6 +493,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testCarrierNetworkChange_carrierNetworkChange() { public void testCarrierNetworkChange_carrierNetworkChange() { int strength = SignalStrength.SIGNAL_STRENGTH_GREAT; int strength = SignalStrength.SIGNAL_STRENGTH_GREAT; Loading Loading @@ -497,6 +523,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testCarrierNetworkChange_roamingBeforeNetworkChange() { public void testCarrierNetworkChange_roamingBeforeNetworkChange() { int strength = SignalStrength.SIGNAL_STRENGTH_GREAT; int strength = SignalStrength.SIGNAL_STRENGTH_GREAT; Loading Loading @@ -530,6 +557,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testCarrierNetworkChange_roamingAfterNetworkChange() { public void testCarrierNetworkChange_roamingAfterNetworkChange() { int strength = SignalStrength.SIGNAL_STRENGTH_GREAT; int strength = SignalStrength.SIGNAL_STRENGTH_GREAT; Loading Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerDataTest.java +13 −1 Original line number Original line Diff line number Diff line Loading @@ -18,10 +18,10 @@ import org.junit.runner.RunWith; @SmallTest @SmallTest @RunWith(AndroidJUnit4.class) @RunWith(AndroidJUnit4.class) @Ignore("Flaky") public class NetworkControllerDataTest extends NetworkControllerBaseTest { public class NetworkControllerDataTest extends NetworkControllerBaseTest { @Test @Test @Ignore("Flaky") public void test3gDataIcon() { public void test3gDataIcon() { setupDefaultSignal(); setupDefaultSignal(); Loading @@ -30,6 +30,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void test2gDataIcon() { public void test2gDataIcon() { setupDefaultSignal(); setupDefaultSignal(); updateDataConnectionState(TelephonyManager.DATA_CONNECTED, updateDataConnectionState(TelephonyManager.DATA_CONNECTED, Loading @@ -40,6 +41,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testCdmaDataIcon() { public void testCdmaDataIcon() { setupDefaultSignal(); setupDefaultSignal(); updateDataConnectionState(TelephonyManager.DATA_CONNECTED, updateDataConnectionState(TelephonyManager.DATA_CONNECTED, Loading @@ -50,6 +52,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testEdgeDataIcon() { public void testEdgeDataIcon() { setupDefaultSignal(); setupDefaultSignal(); updateDataConnectionState(TelephonyManager.DATA_CONNECTED, updateDataConnectionState(TelephonyManager.DATA_CONNECTED, Loading @@ -60,6 +63,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testLteDataIcon() { public void testLteDataIcon() { setupDefaultSignal(); setupDefaultSignal(); updateDataConnectionState(TelephonyManager.DATA_CONNECTED, updateDataConnectionState(TelephonyManager.DATA_CONNECTED, Loading @@ -70,6 +74,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testHspaDataIcon() { public void testHspaDataIcon() { setupDefaultSignal(); setupDefaultSignal(); updateDataConnectionState(TelephonyManager.DATA_CONNECTED, updateDataConnectionState(TelephonyManager.DATA_CONNECTED, Loading @@ -80,6 +85,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testWfcNoDataIcon() { public void testWfcNoDataIcon() { setupDefaultSignal(); setupDefaultSignal(); updateDataConnectionState(TelephonyManager.DATA_CONNECTED, updateDataConnectionState(TelephonyManager.DATA_CONNECTED, Loading @@ -89,6 +95,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void test4gDataIcon() { public void test4gDataIcon() { // Switch to showing 4g icon and re-initialize the NetworkController. // Switch to showing 4g icon and re-initialize the NetworkController. mConfig.show4gForLte = true; mConfig.show4gForLte = true; Loading @@ -108,6 +115,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testDataDisabledIcon() { public void testDataDisabledIcon() { setupNetworkController(); setupNetworkController(); when(mMockTm.getDataEnabled(mSubId)).thenReturn(false); when(mMockTm.getDataEnabled(mSubId)).thenReturn(false); Loading @@ -120,6 +128,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testDataDisabledIcon_UserNotSetup() { public void testDataDisabledIcon_UserNotSetup() { setupNetworkController(); setupNetworkController(); when(mMockTm.getDataEnabled(mSubId)).thenReturn(false); when(mMockTm.getDataEnabled(mSubId)).thenReturn(false); Loading @@ -134,6 +143,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void test4gDataIconConfigChange() { public void test4gDataIconConfigChange() { setupDefaultSignal(); setupDefaultSignal(); updateDataConnectionState(TelephonyManager.DATA_CONNECTED, updateDataConnectionState(TelephonyManager.DATA_CONNECTED, Loading @@ -151,6 +161,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testDataChangeWithoutConnectionState() { public void testDataChangeWithoutConnectionState() { setupDefaultSignal(); setupDefaultSignal(); updateDataConnectionState(TelephonyManager.DATA_CONNECTED, updateDataConnectionState(TelephonyManager.DATA_CONNECTED, Loading @@ -167,6 +178,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testDataActivity() { public void testDataActivity() { setupDefaultSignal(); setupDefaultSignal(); Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java +29 −1 Original line number Original line Diff line number Diff line Loading @@ -48,10 +48,10 @@ import static org.mockito.Mockito.mock; @SmallTest @SmallTest @RunWith(AndroidJUnit4.class) @RunWith(AndroidJUnit4.class) @Ignore("Flaky") public class NetworkControllerSignalTest extends NetworkControllerBaseTest { public class NetworkControllerSignalTest extends NetworkControllerBaseTest { @Test @Test @Ignore("Flaky") public void testNoIconWithoutMobile() { public void testNoIconWithoutMobile() { // Turn off mobile network support. // Turn off mobile network support. Mockito.when(mMockCm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE)).thenReturn(false); Mockito.when(mMockCm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE)).thenReturn(false); Loading @@ -66,6 +66,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testNoSimsIconPresent() { public void testNoSimsIconPresent() { // No Subscriptions. // No Subscriptions. mNetworkController.mMobileSignalControllers.clear(); mNetworkController.mMobileSignalControllers.clear(); Loading @@ -75,6 +76,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testEmergencyOnly() { public void testEmergencyOnly() { setupDefaultSignal(); setupDefaultSignal(); mNetworkController.recalculateEmergency(); mNetworkController.recalculateEmergency(); Loading @@ -86,6 +88,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testEmergencyOnlyNoSubscriptions() { public void testEmergencyOnlyNoSubscriptions() { setupDefaultSignal(); setupDefaultSignal(); setSubscriptions(); setSubscriptions(); Loading @@ -96,6 +99,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testNoEmergencyOnlyWrongSubscription() { public void testNoEmergencyOnlyWrongSubscription() { setupDefaultSignal(); setupDefaultSignal(); setDefaultSubId(42); setDefaultSubId(42); Loading @@ -104,6 +108,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testNoEmengencyNoSubscriptions() { public void testNoEmengencyNoSubscriptions() { setupDefaultSignal(); setupDefaultSignal(); setSubscriptions(); setSubscriptions(); Loading @@ -114,6 +119,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testNoSimlessIconWithoutMobile() { public void testNoSimlessIconWithoutMobile() { // Turn off mobile network support. // Turn off mobile network support. Mockito.when(mMockCm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE)).thenReturn(false); Mockito.when(mMockCm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE)).thenReturn(false); Loading @@ -132,6 +138,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testSignalStrength() { public void testSignalStrength() { for (int testStrength = 0; for (int testStrength = 0; testStrength < SignalStrength.NUM_SIGNAL_STRENGTH_BINS; testStrength++) { testStrength < SignalStrength.NUM_SIGNAL_STRENGTH_BINS; testStrength++) { Loading @@ -149,6 +156,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testCdmaSignalStrength() { public void testCdmaSignalStrength() { for (int testStrength = 0; for (int testStrength = 0; testStrength < SignalStrength.NUM_SIGNAL_STRENGTH_BINS; testStrength++) { testStrength < SignalStrength.NUM_SIGNAL_STRENGTH_BINS; testStrength++) { Loading @@ -163,6 +171,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testSignalRoaming() { public void testSignalRoaming() { for (int testStrength = 0; for (int testStrength = 0; testStrength < SignalStrength.NUM_SIGNAL_STRENGTH_BINS; testStrength++) { testStrength < SignalStrength.NUM_SIGNAL_STRENGTH_BINS; testStrength++) { Loading @@ -177,6 +186,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testCdmaSignalRoaming() { public void testCdmaSignalRoaming() { for (int testStrength = SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN; for (int testStrength = SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN; testStrength <= SignalStrength.SIGNAL_STRENGTH_GREAT; testStrength++) { testStrength <= SignalStrength.SIGNAL_STRENGTH_GREAT; testStrength++) { Loading @@ -192,6 +202,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testQsSignalStrength() { public void testQsSignalStrength() { for (int testStrength = SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN; for (int testStrength = SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN; testStrength <= SignalStrength.SIGNAL_STRENGTH_GREAT; testStrength++) { testStrength <= SignalStrength.SIGNAL_STRENGTH_GREAT; testStrength++) { Loading @@ -205,6 +216,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testCdmaQsSignalStrength() { public void testCdmaQsSignalStrength() { for (int testStrength = SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN; for (int testStrength = SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN; testStrength <= SignalStrength.SIGNAL_STRENGTH_GREAT; testStrength++) { testStrength <= SignalStrength.SIGNAL_STRENGTH_GREAT; testStrength++) { Loading @@ -219,6 +231,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testNoBangWithWifi() { public void testNoBangWithWifi() { setupDefaultSignal(); setupDefaultSignal(); setConnectivity(mMobileSignalController.mTransportType, false, false); setConnectivity(mMobileSignalController.mTransportType, false, false); Loading @@ -230,6 +243,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { // Some tests of actual NetworkController code, just internals not display stuff // Some tests of actual NetworkController code, just internals not display stuff // TODO: Put this somewhere else, maybe in its own file. // TODO: Put this somewhere else, maybe in its own file. @Test @Test @Ignore("Flaky") public void testHasCorrectMobileControllers() { public void testHasCorrectMobileControllers() { int[] testSubscriptions = new int[] { 1, 5, 3 }; int[] testSubscriptions = new int[] { 1, 5, 3 }; int notTestSubscription = 0; int notTestSubscription = 0; Loading Loading @@ -257,6 +271,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testSetCurrentSubscriptions() { public void testSetCurrentSubscriptions() { // We will not add one controller to make sure it gets created. // We will not add one controller to make sure it gets created. int indexToSkipController = 0; int indexToSkipController = 0; Loading Loading @@ -310,6 +325,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testHistorySize() { public void testHistorySize() { // Verify valid history size, otherwise it gits printed out the wrong order and whatnot. // Verify valid history size, otherwise it gits printed out the wrong order and whatnot. assertEquals(0, SignalController.HISTORY_SIZE & (SignalController.HISTORY_SIZE - 1)); assertEquals(0, SignalController.HISTORY_SIZE & (SignalController.HISTORY_SIZE - 1)); Loading @@ -323,6 +339,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testOnReceive_stringsUpdatedAction_spn() { public void testOnReceive_stringsUpdatedAction_spn() { String expectedMNetworkName = "Test"; String expectedMNetworkName = "Test"; Intent intent = createStringsUpdatedIntent(true /* showSpn */, Intent intent = createStringsUpdatedIntent(true /* showSpn */, Loading @@ -336,6 +353,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testOnReceive_stringsUpdatedAction_plmn() { public void testOnReceive_stringsUpdatedAction_plmn() { String expectedMNetworkName = "Test"; String expectedMNetworkName = "Test"; Loading @@ -350,6 +368,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testOnReceive_stringsUpdatedAction_bothFalse() { public void testOnReceive_stringsUpdatedAction_bothFalse() { Intent intent = createStringsUpdatedIntent(false /* showSpn */, Intent intent = createStringsUpdatedIntent(false /* showSpn */, "Irrelevant" /* spn */, "Irrelevant" /* spn */, Loading @@ -365,6 +384,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testOnReceive_stringsUpdatedAction_bothTrueAndNull() { public void testOnReceive_stringsUpdatedAction_bothTrueAndNull() { Intent intent = createStringsUpdatedIntent(true /* showSpn */, Intent intent = createStringsUpdatedIntent(true /* showSpn */, null /* spn */, null /* spn */, Loading @@ -379,6 +399,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testOnReceive_stringsUpdatedAction_bothTrueAndNonNull() { public void testOnReceive_stringsUpdatedAction_bothTrueAndNonNull() { String spn = "Test1"; String spn = "Test1"; String plmn = "Test2"; String plmn = "Test2"; Loading Loading @@ -413,6 +434,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testOnUpdateDataActivity_dataIn() { public void testOnUpdateDataActivity_dataIn() { setupDefaultSignal(); setupDefaultSignal(); Loading @@ -427,6 +449,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testOnUpdateDataActivity_dataOut() { public void testOnUpdateDataActivity_dataOut() { setupDefaultSignal(); setupDefaultSignal(); Loading @@ -440,6 +463,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testOnUpdateDataActivity_dataInOut() { public void testOnUpdateDataActivity_dataInOut() { setupDefaultSignal(); setupDefaultSignal(); Loading @@ -454,6 +478,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testOnUpdateDataActivity_dataActivityNone() { public void testOnUpdateDataActivity_dataActivityNone() { setupDefaultSignal(); setupDefaultSignal(); Loading @@ -468,6 +493,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testCarrierNetworkChange_carrierNetworkChange() { public void testCarrierNetworkChange_carrierNetworkChange() { int strength = SignalStrength.SIGNAL_STRENGTH_GREAT; int strength = SignalStrength.SIGNAL_STRENGTH_GREAT; Loading Loading @@ -497,6 +523,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testCarrierNetworkChange_roamingBeforeNetworkChange() { public void testCarrierNetworkChange_roamingBeforeNetworkChange() { int strength = SignalStrength.SIGNAL_STRENGTH_GREAT; int strength = SignalStrength.SIGNAL_STRENGTH_GREAT; Loading Loading @@ -530,6 +557,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { } } @Test @Test @Ignore("Flaky") public void testCarrierNetworkChange_roamingAfterNetworkChange() { public void testCarrierNetworkChange_roamingAfterNetworkChange() { int strength = SignalStrength.SIGNAL_STRENGTH_GREAT; int strength = SignalStrength.SIGNAL_STRENGTH_GREAT; Loading