diff options
author | Sergey Prigogin <sprigogin@google.com> | 2024-04-30 15:11:12 -0700 |
---|---|---|
committer | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | 2024-04-30 23:24:28 +0000 |
commit | 6102db133b9e4c2fd29431b08a20dd7fc0d4cc63 (patch) | |
tree | 10e84da14a54e2267cd3282661702a5ca936f517 | |
parent | 7b6735a89deb160734a1c5efeea346d1bac5206a (diff) | |
download | idea-mirror-goog-studio-main.tar.gz |
Restore overridden flags after the testmirror-goog-studio-main
Test: existing
Bug: N/A
Change-Id: I0d191191c4672cc84ec9e848c17b42d853f6ff56
-rw-r--r-- | streaming/integration/com/android/tools/idea/streaming/device/ScreenSharingAgentTest.kt | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/streaming/integration/com/android/tools/idea/streaming/device/ScreenSharingAgentTest.kt b/streaming/integration/com/android/tools/idea/streaming/device/ScreenSharingAgentTest.kt index 6f47aa5d572..6653eb41500 100644 --- a/streaming/integration/com/android/tools/idea/streaming/device/ScreenSharingAgentTest.kt +++ b/streaming/integration/com/android/tools/idea/streaming/device/ScreenSharingAgentTest.kt @@ -27,9 +27,11 @@ import com.android.tools.asdriver.tests.Emulator import com.android.tools.idea.flags.StudioFlags import com.android.tools.idea.streaming.core.PRIMARY_DISPLAY_ID import com.android.tools.idea.streaming.device.DeviceView.Companion.ANDROID_SCROLL_ADJUSTMENT_FACTOR +import com.android.tools.idea.testing.flags.override import com.android.tools.tests.IdeaTestSuiteBase import com.android.utils.executeWithRetries import com.google.common.truth.Truth.assertThat +import com.intellij.openapi.Disposable import com.intellij.openapi.util.Disposer import com.intellij.openapi.util.SystemInfo import com.intellij.testFramework.DisposableRule @@ -391,11 +393,13 @@ class ScreenSharingAgentTest { model = "Pixel 5" isRemote = false }) + private var classDisposable: Disposable? = null @JvmStatic @BeforeClass fun setUpClass() { - StudioFlags.DEVICE_MIRRORING_AGENT_LOG_LEVEL.override("debug") + val disposable = Disposer.newDisposable("ScreenSharingAgentTest").also { classDisposable = it } + StudioFlags.DEVICE_MIRRORING_AGENT_LOG_LEVEL.override("debug", disposable) val adbBinary = resolveWorkspacePath("prebuilts/studio/sdk/linux/platform-tools/adb") check(Files.exists(adbBinary)) @@ -445,6 +449,10 @@ class ScreenSharingAgentTest { @JvmStatic @AfterClass fun tearDownClass() { + classDisposable?.let { + Disposer.dispose(it) + classDisposable = null + } emulator.close() // Don't tear this down if setup failed because it will create distracting stacks in the test failure. if (::deviceView.isInitialized) { |