--- /dev/null
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the
+ * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package com.android;
+
+import static org.junit.Assert.assertFalse;
+
+import android.support.test.filters.LargeTest;
+import android.support.test.filters.MediumTest;
+import android.support.test.filters.SmallTest;
+import android.support.test.internal.runner.ClassPathScanner;
+import android.support.test.internal.runner.ClassPathScanner.ChainedClassNameFilter;
+import android.support.test.internal.runner.ClassPathScanner.ExternalClassNameFilter;
+import android.support.test.internal.runner.TestLoader;
+import android.testing.AndroidTestingRunner;
+import android.text.TextUtils;
+import android.util.Log;
+
+import com.android.systemui.SysuiBaseFragmentTest;
+import com.android.systemui.SysuiTestCase;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+
+/**
+ * This is named AAAPlusPlusVerifySysuiRequiredTestPropertiesTest for two reasons.
+ * a) Its so awesome it deserves an AAA++
+ * b) It should run first to draw attention to itself.
+ *
+ * For trues though: this test verifies that all the sysui tests extend the right classes.
+ * This matters because including tests with different context implementations in the same
+ * test suite causes errors, such as the incorrect settings provider being cached.
+ * For an example, see {@link com.android.systemui.DependencyTest}.
+ */
+@RunWith(AndroidTestingRunner.class)
+@SmallTest
+public class AAAPlusPlusVerifySysuiRequiredTestPropertiesTest extends SysuiTestCase {
+
+ private static final String TAG = "AAA++VerifyTest";
+
+ private static final Class[] BASE_CLS_WHITELIST = {
+ SysuiTestCase.class,
+ SysuiBaseFragmentTest.class,
+ };
+
+ private static final Class[] SUPPORTED_SIZES = {
+ SmallTest.class,
+ MediumTest.class,
+ LargeTest.class,
+ android.test.suitebuilder.annotation.SmallTest.class,
+ android.test.suitebuilder.annotation.MediumTest.class,
+ android.test.suitebuilder.annotation.LargeTest.class,
+ };
+
+ @Test
+ public void testAllClassInheritance() {
+ boolean anyClassWrong = false;
+ TestLoader loader = new TestLoader();
+ for (String className : getClassNamesFromClassPath()) {
+ Class<?> cls = loader.loadIfTest(className);
+ if (cls == null) continue;
+
+ boolean hasParent = false;
+ for (Class<?> parent : BASE_CLS_WHITELIST) {
+ if (parent.isAssignableFrom(cls)) {
+ hasParent = true;
+ break;
+ }
+ }
+ boolean hasSize = hasSize(cls);
+ if (!hasSize) {
+ anyClassWrong = true;
+ Log.e(TAG, cls.getName() + " does not have size annotation, such as @SmallTest");
+ }
+ if (!hasParent) {
+ anyClassWrong = true;
+ Log.e(TAG, cls.getName() + " does not extend any of " + getClsStr());
+ }
+ }
+
+ assertFalse("All sysui test classes must have size and extend one of " + getClsStr(),
+ anyClassWrong);
+ }
+
+ private boolean hasSize(Class<?> cls) {
+ for (int i = 0; i < SUPPORTED_SIZES.length; i++) {
+ if (cls.getDeclaredAnnotation(SUPPORTED_SIZES[i]) != null) return true;
+ }
+ return false;
+ }
+
+ private Collection<String> getClassNamesFromClassPath() {
+ ClassPathScanner scanner = new ClassPathScanner(mContext.getPackageCodePath());
+
+ ChainedClassNameFilter filter = new ChainedClassNameFilter();
+
+ filter.add(new ExternalClassNameFilter());
+ filter.add(s -> s.startsWith("com.android.systemui")
+ || s.startsWith("com.android.keyguard"));
+ try {
+ return scanner.getClassPathEntries(filter);
+ } catch (IOException e) {
+ Log.e(TAG, "Failed to scan classes", e);
+ }
+ return Collections.emptyList();
+ }
+
+ private String getClsStr() {
+ return TextUtils.join(",", Arrays.asList(BASE_CLS_WHITELIST)
+ .stream().map(cls -> cls.getSimpleName()).toArray());
+ }
+}
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-import android.content.Context;
-import android.support.test.InstrumentationRegistry;
+import android.support.test.filters.SmallTest;
import android.text.TextUtils;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.TextView;
+import com.android.systemui.SysuiTestCase;
+
import org.junit.Before;
import org.junit.Test;
import java.util.List;
-public class KeyguardClockAccessibilityDelegateTest {
+@SmallTest
+public class KeyguardClockAccessibilityDelegateTest extends SysuiTestCase {
- private Context mContext;
private TextView mView;
@Before
public void setUp() throws Exception {
- mContext = InstrumentationRegistry.getContext();
mView = new TextView(mContext);
mView.setText(R.string.keyguard_widget_12_hours_format);
mView.setContentDescription(mContext.getString(R.string.keyguard_widget_12_hours_format));
import static org.mockito.Mockito.verify;
import android.os.Looper;
+import android.support.test.filters.SmallTest;
import com.android.systemui.Dependency.DependencyKey;
import com.android.systemui.statusbar.policy.FlashlightController;
import java.io.PrintWriter;
+@SmallTest
public class DependencyTest extends SysuiTestCase {
public static final DependencyKey<Dumpable> DUMPABLE = new DependencyKey<>("dumpable");
import android.os.Looper;
import android.os.MessageQueue;
import android.support.test.InstrumentationRegistry;
+import android.support.test.filters.SmallTest;
import android.testing.LeakCheck;
import android.util.Log;
import android.view.Display;
import com.android.internal.hardware.AmbientDisplayConfiguration;
+import com.android.systemui.SysuiTestCase;
import com.android.systemui.util.wakelock.WakeLockFake;
import android.testing.UiThreadTest;
@SmallTest
@RunWith(AndroidTestingRunner.class)
@UiThreadTest
-public class DozeMachineTest {
+public class DozeMachineTest extends SysuiTestCase {
DozeMachine mMachine;
import android.support.test.filters.SmallTest;
import android.view.Display;
+import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.phone.DozeParameters;
import org.junit.Before;
import org.junit.Test;
@SmallTest
-public class DozeScreenStatePreventingAdapterTest {
+public class DozeScreenStatePreventingAdapterTest extends SysuiTestCase {
private DozeMachine.Service mInner;
private DozeScreenStatePreventingAdapter mWrapper;
import android.support.test.runner.AndroidJUnit4;
import com.android.internal.hardware.AmbientDisplayConfiguration;
+import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.phone.DozeParameters;
import com.android.systemui.util.wakelock.WakeLock;
import com.android.systemui.util.wakelock.WakeLockFake;
@SmallTest
@RunWith(AndroidJUnit4.class)
-public class DozeTriggersTest {
- private Context mContext;
+public class DozeTriggersTest extends SysuiTestCase {
private DozeTriggers mTriggers;
private DozeMachine mMachine;
private DozeHostFake mHost;
@Before
public void setUp() throws Exception {
mInstrumentation = InstrumentationRegistry.getInstrumentation();
- mContext = InstrumentationRegistry.getContext();
mMachine = mock(DozeMachine.class);
mHost = new DozeHostFake();
mConfig = DozeConfigurationUtil.createMockConfig();
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;
+import com.android.systemui.SysuiTestCase;
import com.android.systemui.keyguard.WorkLockActivity;
import com.android.systemui.keyguard.WorkLockActivityController;
import com.android.systemui.recents.misc.SystemServicesProxy;
*/
@SmallTest
@RunWith(AndroidJUnit4.class)
-public class WorkLockActivityControllerTest {
+public class WorkLockActivityControllerTest extends SysuiTestCase {
private static final int USER_ID = 333;
private static final int TASK_ID = 444;
import android.graphics.Color;
import android.os.Looper;
+import com.android.systemui.SysuiTestCase;
import com.android.systemui.keyguard.WorkLockActivity;
import org.junit.Before;
*/
@SmallTest
@RunWith(AndroidJUnit4.class)
-public class WorkLockActivityTest {
+public class WorkLockActivityTest extends SysuiTestCase {
private static final @UserIdInt int USER_ID = 270;
private static final String TASK_LABEL = "task label";
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
+import android.support.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import com.android.systemui.plugins.VersionInfo.InvalidVersionException;
import com.android.systemui.plugins.annotations.Requires;
import org.junit.Test;
import org.junit.rules.ExpectedException;
+@SmallTest
public class VersionInfoTest extends SysuiTestCase {
@Rule
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import android.support.test.filters.FlakyTest;
+import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
@RunWith(AndroidTestingRunner.class)
@RunWithLooper
-@FlakyTest
+@SmallTest
public class QSDetailTest extends SysuiTestCase {
private MetricsLogger mMetricsLogger;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import android.support.test.filters.FlakyTest;
+import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
@RunWith(AndroidTestingRunner.class)
@RunWithLooper
-@FlakyTest
+@SmallTest
public class QSFooterTest extends LeakCheckedTest {
private QSFooter mFooter;
import com.android.systemui.R;
import android.os.Parcelable;
+import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import com.android.systemui.SysuiBaseFragmentTest;
@RunWith(AndroidTestingRunner.class)
@RunWithLooper(setAsMainLooper = true)
-@FlakyTest
+@SmallTest
public class QSFragmentTest extends SysuiBaseFragmentTest {
private MetricsLogger mMockMetricsLogger;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
-import android.support.test.filters.FlakyTest;
+import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
@RunWith(AndroidTestingRunner.class)
@RunWithLooper
-@FlakyTest
+@SmallTest
public class QSPanelTest extends SysuiTestCase {
private MetricsLogger mMetricsLogger;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
+import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
@RunWith(AndroidTestingRunner.class)
@RunWithLooper
+@SmallTest
public class TileAdapterTest extends SysuiTestCase {
private TileAdapter mTileAdapter;
import android.content.res.ColorStateList;
import android.graphics.drawable.Drawable;
import android.service.quicksettings.Tile;
+import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.UiThreadTest;
import android.widget.ImageView;
@RunWith(AndroidTestingRunner.class)
@UiThreadTest
+@SmallTest
public class QSIconViewImplTest extends SysuiTestCase {
private QSIconViewImpl mIconView;
import android.content.Intent;
import android.metrics.LogMaker;
+import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
@RunWith(AndroidTestingRunner.class)
@RunWithLooper
+@SmallTest
public class QSTileImplTest extends SysuiTestCase {
public static final int POSITION = 14;
package com.android.systemui.settings;
import android.content.Intent;
+import android.support.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
/**
* Testing functionality of the current user tracker
*/
+@SmallTest
public class CurrentUserTrackerTest extends SysuiTestCase {
private CurrentUserTracker mTracker;
import android.content.ComponentName;
import android.graphics.Rect;
import android.os.Bundle;
+import android.support.test.filters.SmallTest;
import com.android.internal.statusbar.StatusBarIcon;
import com.android.systemui.SysuiTestCase;
import org.junit.Before;
import org.junit.Test;
+@SmallTest
public class CommandQueueTest extends SysuiTestCase {
private CommandQueue mCommandQueue;
import android.view.View;
import com.android.systemui.statusbar.stack.NotificationChildrenContainer;
+import com.android.systemui.SysuiTestCase;
import org.junit.Assert;
import org.junit.Before;
@SmallTest
@RunWith(AndroidJUnit4.class)
-@FlakyTest
-public class ExpandableNotificationRowTest {
+public class ExpandableNotificationRowTest extends SysuiTestCase {
- private Context mContext;
private ExpandableNotificationRow mGroup;
private NotificationTestHelper mNotificationTestHelper;
@Before
public void setUp() throws Exception {
- mContext = InstrumentationRegistry.getTargetContext();
mNotificationTestHelper = new NotificationTestHelper(mContext);
mGroup = mNotificationTestHelper.createGroup();
}
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
+import com.android.systemui.SysuiTestCase;
+
@SmallTest
@RunWith(AndroidJUnit4.class)
-@FlakyTest
-public class NotificationContentViewTest {
+public class NotificationContentViewTest extends SysuiTestCase {
NotificationContentView mView;
- Context mContext;
@Before
@UiThreadTest
public void setup() {
- mContext = InstrumentationRegistry.getTargetContext();
mView = new NotificationContentView(mContext, null);
ExpandableNotificationRow row = new ExpandableNotificationRow(mContext, null);
ExpandableNotificationRow mockRow = spy(row);
import android.widget.RemoteViews;
import com.android.systemui.R;
+import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.notification.NotificationCustomViewWrapper;
import com.android.systemui.statusbar.notification.NotificationViewWrapper;
@SmallTest
@RunWith(AndroidJUnit4.class)
-@FlakyTest
-public class NotificationCustomViewWrapperTest {
+public class NotificationCustomViewWrapperTest extends SysuiTestCase {
- private Context mContext;
private ExpandableNotificationRow mRow;
@Before
@UiThreadTest
public void setUp() {
- mContext = InstrumentationRegistry.getTargetContext();
mRow = new ExpandableNotificationRow(mContext, null);
}
import static junit.framework.Assert.assertTrue;
+import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
@RunWith(AndroidTestingRunner.class)
@RunWithLooper(setAsMainLooper = true)
+@SmallTest
public class NotificationMenuRowTest extends LeakCheckedTest {
@Before
import android.widget.RemoteViews;
import com.android.systemui.R;
+import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.ExpandableNotificationRow;
import com.android.systemui.statusbar.NotificationData;
import com.android.systemui.statusbar.NotificationTestHelper;
@SmallTest
@RunWith(AndroidJUnit4.class)
-@FlakyTest
-public class NotificationInflaterTest {
+public class NotificationInflaterTest extends SysuiTestCase {
- private Context mContext;
private NotificationInflater mNotificationInflater;
private Notification.Builder mBuilder;
private ExpandableNotificationRow mRow;
@Before
public void setUp() throws Exception {
- mContext = InstrumentationRegistry.getTargetContext();
mBuilder = new Notification.Builder(mContext).setSmallIcon(
R.drawable.ic_person)
.setContentTitle("Title")
import android.content.Context;
import android.support.test.InstrumentationRegistry;
+import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;
import android.view.View;
+import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.ExpandableNotificationRow;
import org.junit.Before;
import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
-public class NotificationViewWrapperTest {
-
- private Context mContext;
-
- @Before
- public void setUp() throws Exception {
- mContext = InstrumentationRegistry.getTargetContext();
- }
+@SmallTest
+public class NotificationViewWrapperTest extends SysuiTestCase {
@Test
public void constructor_doesntUseViewContext() throws Exception {
import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
+import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.ExpandableNotificationRow;
import com.android.systemui.statusbar.NotificationData;
import com.android.systemui.statusbar.notification.VisibilityLocationProvider;
@SmallTest
@RunWith(AndroidJUnit4.class)
-public class VisualStabilityManagerTest {
+public class VisualStabilityManagerTest extends SysuiTestCase {
private VisualStabilityManager mVisualStabilityManager = new VisualStabilityManager();
private VisualStabilityManager.Callback mCallback = mock(VisualStabilityManager.Callback.class);
import com.android.internal.app.NightDisplayController;
import com.android.systemui.Prefs;
import com.android.systemui.Prefs.Key;
+
+import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.qs.QSTileHost;
import org.mockito.Mockito;
@RunWith(AndroidTestingRunner.class)
+@SmallTest
public class AutoTileManagerTest extends SysuiTestCase {
private QSTileHost mQsTileHost;
import static org.mockito.Mockito.when;
import android.app.StatusBarManager;
+import android.support.test.filters.SmallTest;
import android.view.View;
import android.view.ViewPropertyAnimator;
@RunWith(AndroidTestingRunner.class)
@RunWithLooper(setAsMainLooper = true)
+@SmallTest
public class CollapsedStatusBarFragmentTest extends SysuiBaseFragmentTest {
private NotificationIconAreaController mMockNotificiationAreaController;
import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
+
+import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.phone.DozeParameters.IntInOutMatcher;
import org.junit.Test;
import org.junit.runner.RunWith;
@SmallTest
@RunWith(AndroidJUnit4.class)
-public class DozeParametersTest {
+public class DozeParametersTest extends SysuiTestCase {
@Test
public void test_inOutMatcher_defaultIn() {
import android.content.Context;
import android.os.Looper;
+import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.LeakCheck.Tracker;
import android.view.Display;
@RunWith(AndroidTestingRunner.class)
@RunWithLooper(setAsMainLooper = true)
+@SmallTest
public class NavigationBarFragmentTest extends SysuiBaseFragmentTest {
public NavigationBarFragmentTest() {
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
+import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
import android.view.ViewGroup;
@RunWith(AndroidTestingRunner.class)
@RunWithLooper
+@SmallTest
public class StatusBarIconControllerTest extends LeakCheckedTest {
@Before
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothProfile;
+import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
@RunWith(AndroidTestingRunner.class)
@RunWithLooper
+@SmallTest
public class BluetoothControllerImplTest extends SysuiTestCase {
private LocalBluetoothManager mMockBluetoothManager;
import android.telephony.SubscriptionInfo;
import android.test.suitebuilder.annotation.SmallTest;
import com.android.systemui.R;
+import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.policy.NetworkController.EmergencyListener;
import com.android.systemui.statusbar.policy.NetworkController.IconState;
import com.android.systemui.statusbar.policy.NetworkController.SignalCallback;
@SmallTest
@RunWith(AndroidJUnit4.class)
-public class CallbackHandlerTest {
+public class CallbackHandlerTest extends SysuiTestCase {
private CallbackHandler mHandler;
private HandlerThread mHandlerThread;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
+import android.support.test.filters.SmallTest;
+
import com.android.systemui.Dependency;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.plugins.OverlayPlugin;
import java.util.Map;
import java.util.function.Consumer;
+@SmallTest
public class ExtensionControllerTest extends SysuiTestCase {
private PluginManager mPluginManager;
import static org.mockito.ArgumentMatchers.argThat;
import android.metrics.LogMaker;
+import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
@RunWith(AndroidTestingRunner.class)
@RunWithLooper
+@SmallTest
public class KeyButtonViewTest extends SysuiTestCase {
private KeyButtonView mKeyButtonView;
import android.view.NotificationHeaderView;
import android.view.View;
+import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.ExpandableNotificationRow;
import com.android.systemui.statusbar.NotificationTestHelper;
@SmallTest
@RunWith(AndroidJUnit4.class)
-@FlakyTest
-public class NotificationChildrenContainerTest {
+public class NotificationChildrenContainerTest extends SysuiTestCase {
- private Context mContext;
private ExpandableNotificationRow mGroup;
private int mId;
private NotificationTestHelper mNotificationTestHelper;
@Before
public void setUp() throws Exception {
- mContext = InstrumentationRegistry.getTargetContext();
mNotificationTestHelper = new NotificationTestHelper(mContext);
mGroup = mNotificationTestHelper.createGroup();
}
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;
+import com.android.systemui.SysuiTestCase;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@SmallTest
@RunWith(AndroidJUnit4.class)
-public class GarbageMonitorTest {
+public class GarbageMonitorTest extends SysuiTestCase {
private LeakReporter mLeakReporter;
private TrackedGarbage mTrackedGarbage;
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;
+import com.android.systemui.SysuiTestCase;
import com.android.systemui.util.leak.ReferenceTestUtils.CollectionWaiter;
import org.junit.Before;
@SmallTest
@RunWith(AndroidJUnit4.class)
-public class LeakDetectorTest {
+public class LeakDetectorTest extends SysuiTestCase {
private LeakDetector mLeakDetector;
import static org.mockito.Mockito.verify;
import android.app.NotificationManager;
+import android.support.test.filters.MediumTest;
import android.support.test.runner.AndroidJUnit4;
import com.android.systemui.SysuiTestCase;
import java.io.PrintWriter;
@RunWith(AndroidJUnit4.class)
+@MediumTest
public class LeakReporterTest extends SysuiTestCase {
private LeakDetector mLeakDetector;
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;
+import com.android.systemui.SysuiTestCase;
+
import org.junit.Test;
import org.junit.runner.RunWith;
@SmallTest
@RunWith(AndroidJUnit4.class)
-public class ReferenceTestUtilsTest {
+public class ReferenceTestUtilsTest extends SysuiTestCase {
@Test
public void testCollectionWaiter_doesntBlockIndefinitely() {
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;
+import com.android.systemui.SysuiTestCase;
import com.android.systemui.util.leak.ReferenceTestUtils.CollectionWaiter;
import org.junit.Before;
@SmallTest
@RunWith(AndroidJUnit4.class)
-public class WeakIdentityHashMapTest {
+public class WeakIdentityHashMapTest extends SysuiTestCase {
WeakIdentityHashMap<Object, Object> mMap;
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;
+import com.android.systemui.SysuiTestCase;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@SmallTest
@RunWith(AndroidJUnit4.class)
-public class SettableWakeLockTest {
+public class SettableWakeLockTest extends SysuiTestCase {
private WakeLockFake mFake;
private SettableWakeLock mSettable;
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;
+import com.android.systemui.SysuiTestCase;
+
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@SmallTest
@RunWith(AndroidJUnit4.class)
-public class WakeLockTest {
+public class WakeLockTest extends SysuiTestCase {
WakeLock mWakeLock;
PowerManager.WakeLock mInner;