Loading packages/SystemUI/multivalentTests/src/com/android/systemui/screenshot/ui/viewmodel/ScreenshotViewModelTest.kt +7 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.screenshot.ui.viewmodel import android.view.accessibility.AccessibilityManager import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.google.common.truth.Truth.assertThat import org.junit.Test import org.junit.runner.RunWith Loading Loading @@ -79,4 +80,10 @@ class ScreenshotViewModelTest { assertThat(updated.appearance).isEqualTo(otherAppearance) assertThat(updated.onClicked).isEqualTo(onclick) } companion object { init { SysuiTestCase.waitUntilMockitoCanBeInitialized() } } } packages/SystemUI/tests/utils/src/com/android/systemui/SysuiTestCase.java +11 −1 Original line number Diff line number Diff line Loading @@ -193,7 +193,7 @@ public abstract class SysuiTestCase { private SysuiTestDependency mSysuiDependency; static { assertTempFilesAreCreatable(); waitUntilMockitoCanBeInitialized(); } @Before Loading @@ -219,6 +219,16 @@ public abstract class SysuiTestCase { } } /** * Due to b/404544974, it is possible for a test process to start without access to its * temp folder, and then gain access later. Mockito cannot initialize (b/391948934) if the * temp folder is not writeable, so calling this method allows a test not to proceed until * mockito will be workable. */ public static void waitUntilMockitoCanBeInitialized() { assertTempFilesAreCreatable(); } private static Boolean sCanCreateTempFiles = null; private static void assertTempFilesAreCreatable() throws RuntimeException { // TODO(b/391948934): hopefully remove this hack Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/screenshot/ui/viewmodel/ScreenshotViewModelTest.kt +7 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.screenshot.ui.viewmodel import android.view.accessibility.AccessibilityManager import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.google.common.truth.Truth.assertThat import org.junit.Test import org.junit.runner.RunWith Loading Loading @@ -79,4 +80,10 @@ class ScreenshotViewModelTest { assertThat(updated.appearance).isEqualTo(otherAppearance) assertThat(updated.onClicked).isEqualTo(onclick) } companion object { init { SysuiTestCase.waitUntilMockitoCanBeInitialized() } } }
packages/SystemUI/tests/utils/src/com/android/systemui/SysuiTestCase.java +11 −1 Original line number Diff line number Diff line Loading @@ -193,7 +193,7 @@ public abstract class SysuiTestCase { private SysuiTestDependency mSysuiDependency; static { assertTempFilesAreCreatable(); waitUntilMockitoCanBeInitialized(); } @Before Loading @@ -219,6 +219,16 @@ public abstract class SysuiTestCase { } } /** * Due to b/404544974, it is possible for a test process to start without access to its * temp folder, and then gain access later. Mockito cannot initialize (b/391948934) if the * temp folder is not writeable, so calling this method allows a test not to proceed until * mockito will be workable. */ public static void waitUntilMockitoCanBeInitialized() { assertTempFilesAreCreatable(); } private static Boolean sCanCreateTempFiles = null; private static void assertTempFilesAreCreatable() throws RuntimeException { // TODO(b/391948934): hopefully remove this hack Loading