Fixing MainThreadInitializedObject
> Making SafeCloseable implementation mandatory, to prevent leaks during test and preview > Removing getNoCreate method and defining executeIfCreated to avoid null pointer exceptions > Fixing sandbox value leaking into main, by Checking sandbox against App context > Converting sanbox to an interface instead a class Bug: 335280439 Test: Presubmit Flag: None Change-Id: I951dcde871898e745ff6490a1c4f8fd1512888f5
This commit is contained in:
1 parent
1f40fa0e7f
commit
10fa016352
35 files changed
+233
-245
No files matched your search
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package com.android.quickstep;
|
||||
|
||||
import static androidx.test.InstrumentationRegistry.getTargetContext;
|
||||
|
||||
import static com.android.launcher3.util.TestConstants.AppNames.TEST_APP_NAME;
|
||||
import static com.android.quickstep.TaplTestsTaskbar.TaskbarMode.PERSISTENT;
|
||||
import static com.android.quickstep.TaplTestsTaskbar.TaskbarMode.TRANSIENT;
|
||||
@@ -53,7 +55,7 @@ public class TaplTestsTaskbar extends AbstractTaplTestsTaskbar {
|
||||
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
mTaskbarWasInTransientMode = isTaskbarInTransientMode(mTargetContext);
|
||||
mTaskbarWasInTransientMode = isTaskbarInTransientMode(getTargetContext());
|
||||
setTaskbarMode(mLauncher, isTaskbarTestModeTransient());
|
||||
super.setUp();
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ import org.mockito.MockitoAnnotations
|
||||
import org.mockito.kotlin.any
|
||||
import org.mockito.kotlin.anyOrNull
|
||||
import org.mockito.kotlin.doNothing
|
||||
import org.mockito.kotlin.doReturn
|
||||
import org.mockito.kotlin.eq
|
||||
import org.mockito.kotlin.never
|
||||
import org.mockito.kotlin.spy
|
||||
@@ -100,8 +101,7 @@ class AppPairsControllerTest {
|
||||
// Stub methods on appPairsController so that they return mocks
|
||||
spyAppPairsController = spy(appPairsController)
|
||||
whenever(mockAppPairIcon.context).thenReturn(mockTaskbarActivityContext)
|
||||
whenever(spyAppPairsController.getTopTaskTracker(mockTaskbarActivityContext))
|
||||
.thenReturn(mockTopTaskTracker)
|
||||
doReturn(mockTopTaskTracker).whenever(spyAppPairsController).topTaskTracker
|
||||
whenever(mockTopTaskTracker.getCachedTopTask(any())).thenReturn(mockCachedTaskInfo)
|
||||
whenever(mockTask1.getKey()).thenReturn(mockTaskKey1)
|
||||
whenever(mockTask2.getKey()).thenReturn(mockTaskKey2)
|
||||
|
||||
Reference in new issue
Block a user