diff options
author | Jason Monk <jmonk@google.com> | 2014-11-17 14:40:56 -0500 |
---|---|---|
committer | Jason Monk <jmonk@google.com> | 2014-11-17 14:46:11 -0500 |
commit | 29f7a7b0ae2264651c176ef50cc21cf9131247e3 (patch) | |
tree | 947850df433e5efff293164a2b47c2137f99f728 /packages/SystemUI/tests/src/com | |
parent | 61a848dd2e095336c341af68ed01564c0f3cb442 (diff) | |
download | frameworks_base-29f7a7b0ae2264651c176ef50cc21cf9131247e3.zip frameworks_base-29f7a7b0ae2264651c176ef50cc21cf9131247e3.tar.gz frameworks_base-29f7a7b0ae2264651c176ef50cc21cf9131247e3.tar.bz2 |
SysUI Tests: Make tests not break SysUI
Now you can run the tests without getting the blank broken sysui.
The tests instrument themselves so they include all of the source
they need to run rather than piggybacking on the sysui process.
A couple of changes were needed for this. The xml files cannot
reference com.android.systemui, instead they must use res-auto.
The tests can no longer make privileged calls, so some restructuring
to avoid those calls was needed.
Bug: 18222975
Change-Id: I67b794af854f1420583d48960bd6e52ca753b56d
Diffstat (limited to 'packages/SystemUI/tests/src/com')
4 files changed, 8 insertions, 3 deletions
diff --git a/packages/SystemUI/tests/src/com/android/systemui/EventLogTags.logtags b/packages/SystemUI/tests/src/com/android/systemui/EventLogTags.logtags new file mode 120000 index 0000000..2f243d7 --- /dev/null +++ b/packages/SystemUI/tests/src/com/android/systemui/EventLogTags.logtags @@ -0,0 +1 @@ +../../../../../src/com/android/systemui/EventLogTags.logtags
\ No newline at end of file diff --git a/packages/SystemUI/tests/src/com/android/systemui/screenshot/ScreenshotStubActivity.java b/packages/SystemUI/tests/src/com/android/systemui/screenshot/ScreenshotStubActivity.java index 2935373..784d035 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/screenshot/ScreenshotStubActivity.java +++ b/packages/SystemUI/tests/src/com/android/systemui/screenshot/ScreenshotStubActivity.java @@ -15,7 +15,7 @@ */ package com.android.systemui.screenshot; -import com.android.systemui.tests.R; +import com.android.systemui.R; import android.app.Activity; import android.os.Bundle; diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java index 97605ea..10cffc4 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java @@ -62,7 +62,8 @@ public class NetworkControllerBaseTest extends AndroidTestCase { mSignalCluster = mock(SignalCluster.class); mNetworkSignalChangedCallback = mock(NetworkSignalChangedCallback.class); - mNetworkController = new NetworkControllerImpl(mContext, mMockCm, mMockTm, mMockWm); + mNetworkController = new NetworkControllerImpl(mContext, mMockCm, mMockTm, mMockWm, + mock(AccessPointController.class), mock(MobileDataController.class)); setupNetworkController(); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java index ed76ae5..af05309 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java @@ -1,5 +1,7 @@ package com.android.systemui.statusbar.policy; +import static org.mockito.Mockito.mock; + import android.net.ConnectivityManager; import android.telephony.ServiceState; import android.telephony.SignalStrength; @@ -15,7 +17,8 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { // Turn off mobile network support. Mockito.when(mMockCm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE)).thenReturn(false); // Create a new NetworkController as this is currently handled in constructor. - mNetworkController = new NetworkControllerImpl(mContext, mMockCm, mMockTm, mMockWm); + mNetworkController = new NetworkControllerImpl(mContext, mMockCm, mMockTm, mMockWm, + mock(AccessPointController.class), mock(MobileDataController.class)); setupNetworkController(); verifyLastMobileDataIndicators(false, 0, 0); |