Loading tests/unit/src/com/android/settings/wifi/tether/TetherServiceTest.java +0 −33 Original line number Diff line number Diff line Loading @@ -50,7 +50,6 @@ import android.content.pm.ActivityInfo; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.res.Resources; import android.net.TetheringManager; import android.net.wifi.WifiManager; import android.os.Bundle; Loading Loading @@ -78,13 +77,11 @@ public class TetherServiceTest extends ServiceTestCase<TetherService> { private static final String TEST_RESPONSE_ACTION = "testProvisioningResponseAction"; private static final String TEST_NO_UI_ACTION = "testNoUiProvisioningRequestAction"; private static final int BOGUS_RECEIVER_RESULT = -5; private static final int TEST_CHECK_PERIOD = 100; private static final int MS_PER_HOUR = 60 * 60 * 1000; private static final int SHORT_TIMEOUT = 100; private static final int PROVISION_TIMEOUT = 1000; private TetherService mService; private MockResources mResources; private MockTetherServiceWrapper mWrapper; int mLastReceiverResultCode = BOGUS_RECEIVER_RESULT; private int mLastTetherRequestType = TETHERING_INVALID; Loading @@ -109,7 +106,6 @@ public class TetherServiceTest extends ServiceTestCase<TetherService> { super.setUp(); MockitoAnnotations.initMocks(this); mResources = new MockResources(); mContext = new TestContextWrapper(getContext()); setContext(mContext); Loading Loading @@ -302,41 +298,12 @@ public class TetherServiceTest extends ServiceTestCase<TetherService> { } } private static class MockResources extends android.test.mock.MockResources { @Override public int getInteger(int id) { switch(id) { case com.android.internal.R.integer.config_mobile_hotspot_provision_check_period: return TEST_CHECK_PERIOD; default: return 0; } } @Override public String getString(int id) { switch(id) { case com.android.internal.R.string.config_mobile_hotspot_provision_response: return TEST_RESPONSE_ACTION; case com.android.internal.R.string.config_mobile_hotspot_provision_app_no_ui: return TEST_NO_UI_ACTION; default: return null; } } } private class TestContextWrapper extends ContextWrapper { public TestContextWrapper(Context base) { super(base); } @Override public Resources getResources() { return mResources; } @Override public SharedPreferences getSharedPreferences(String name, int mode) { // Stub out prefs to control the persisted tether type list. Loading Loading
tests/unit/src/com/android/settings/wifi/tether/TetherServiceTest.java +0 −33 Original line number Diff line number Diff line Loading @@ -50,7 +50,6 @@ import android.content.pm.ActivityInfo; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.res.Resources; import android.net.TetheringManager; import android.net.wifi.WifiManager; import android.os.Bundle; Loading Loading @@ -78,13 +77,11 @@ public class TetherServiceTest extends ServiceTestCase<TetherService> { private static final String TEST_RESPONSE_ACTION = "testProvisioningResponseAction"; private static final String TEST_NO_UI_ACTION = "testNoUiProvisioningRequestAction"; private static final int BOGUS_RECEIVER_RESULT = -5; private static final int TEST_CHECK_PERIOD = 100; private static final int MS_PER_HOUR = 60 * 60 * 1000; private static final int SHORT_TIMEOUT = 100; private static final int PROVISION_TIMEOUT = 1000; private TetherService mService; private MockResources mResources; private MockTetherServiceWrapper mWrapper; int mLastReceiverResultCode = BOGUS_RECEIVER_RESULT; private int mLastTetherRequestType = TETHERING_INVALID; Loading @@ -109,7 +106,6 @@ public class TetherServiceTest extends ServiceTestCase<TetherService> { super.setUp(); MockitoAnnotations.initMocks(this); mResources = new MockResources(); mContext = new TestContextWrapper(getContext()); setContext(mContext); Loading Loading @@ -302,41 +298,12 @@ public class TetherServiceTest extends ServiceTestCase<TetherService> { } } private static class MockResources extends android.test.mock.MockResources { @Override public int getInteger(int id) { switch(id) { case com.android.internal.R.integer.config_mobile_hotspot_provision_check_period: return TEST_CHECK_PERIOD; default: return 0; } } @Override public String getString(int id) { switch(id) { case com.android.internal.R.string.config_mobile_hotspot_provision_response: return TEST_RESPONSE_ACTION; case com.android.internal.R.string.config_mobile_hotspot_provision_app_no_ui: return TEST_NO_UI_ACTION; default: return null; } } } private class TestContextWrapper extends ContextWrapper { public TestContextWrapper(Context base) { super(base); } @Override public Resources getResources() { return mResources; } @Override public SharedPreferences getSharedPreferences(String name, int mode) { // Stub out prefs to control the persisted tether type list. Loading