Loading libs/WindowManager/Shell/multivalentScreenshotTests/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,8 @@ android_test { "truth", "platform-parametric-runner-lib", "platform-screenshot-diff-core", "platform-test-annotations", "platform-test-rules", ], libs: [ "android.test.base.stubs.system", Loading libs/WindowManager/Shell/multivalentScreenshotTests/src/com/android/wm/shell/shared/bubbles/DragZoneFactoryScreenshotTest.kt +7 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ import android.content.Context import android.graphics.Color import android.graphics.drawable.Drawable import android.graphics.drawable.GradientDrawable import android.platform.test.annotations.EnableFlags import android.platform.test.flag.junit.SetFlagsRule import android.view.View import android.view.WindowManager import android.widget.FrameLayout Loading @@ -29,6 +31,8 @@ import androidx.core.graphics.green import androidx.core.graphics.red import androidx.core.graphics.toColorInt import androidx.test.core.app.ApplicationProvider.getApplicationContext import com.android.wm.shell.Flags.FLAG_ENABLE_BUBBLE_TO_FULLSCREEN import com.android.wm.shell.Flags.FLAG_ENABLE_CREATE_ANY_BUBBLE import com.android.wm.shell.shared.bubbles.DragZoneFactory.BubbleBarPropertiesProvider import com.android.wm.shell.shared.bubbles.DragZoneFactory.DesktopWindowModeChecker import com.android.wm.shell.shared.bubbles.DragZoneFactory.SplitScreenModeChecker Loading @@ -45,6 +49,7 @@ import platform.test.screenshot.ViewScreenshotTestRule import platform.test.screenshot.ViewScreenshotTestRule.Mode import platform.test.screenshot.getEmulatedDevicePathConfig @EnableFlags(FLAG_ENABLE_BUBBLE_TO_FULLSCREEN, FLAG_ENABLE_CREATE_ANY_BUBBLE) @RunWith(ParameterizedAndroidJunit4::class) class DragZoneFactoryScreenshotTest(private val param: Param) { companion object { Loading Loading @@ -108,6 +113,8 @@ class DragZoneFactoryScreenshotTest(private val param: Param) { override fun toString() = "${emulationSpec}_$testName" } @get:Rule val flagsRule = SetFlagsRule() @get:Rule val screenshotRule = ViewScreenshotTestRule( Loading libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/bubbles/DragZoneFactory.kt +6 −2 Original line number Diff line number Diff line Loading @@ -220,7 +220,9 @@ class DragZoneFactory( is DraggedObject.Bubble -> { dragZones.add(createDismissDragZone()) dragZones.addAll(createBubbleCornerDragZones()) if (BubbleAnythingFlagHelper.enableBubbleToFullscreen()) { dragZones.add(createFullScreenDragZone()) } if (shouldShowDesktopWindowDragZones()) { dragZones.add(createDesktopWindowDragZoneForBubble()) } Loading @@ -228,7 +230,9 @@ class DragZoneFactory( } is DraggedObject.ExpandedView -> { dragZones.add(createDismissDragZone()) if (BubbleAnythingFlagHelper.enableBubbleToFullscreen()) { dragZones.add(createFullScreenDragZone()) } if (shouldShowDesktopWindowDragZones()) { dragZones.add(createDesktopWindowDragZoneForExpandedView()) } Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/shared/bubbles/DragZoneFactoryTest.kt +8 −0 Original line number Diff line number Diff line Loading @@ -19,24 +19,32 @@ package com.android.wm.shell.shared.bubbles import android.content.Context import android.graphics.Insets import android.graphics.Rect import android.platform.test.annotations.EnableFlags import android.platform.test.flag.junit.SetFlagsRule import androidx.test.core.app.ApplicationProvider.getApplicationContext import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.wm.shell.Flags.FLAG_ENABLE_BUBBLE_TO_FULLSCREEN import com.android.wm.shell.Flags.FLAG_ENABLE_CREATE_ANY_BUBBLE import com.android.wm.shell.shared.bubbles.DragZoneFactory.BubbleBarPropertiesProvider import com.android.wm.shell.shared.bubbles.DragZoneFactory.DesktopWindowModeChecker import com.android.wm.shell.shared.bubbles.DragZoneFactory.SplitScreenModeChecker import com.android.wm.shell.shared.bubbles.DragZoneFactory.SplitScreenModeChecker.SplitScreenMode import com.google.common.truth.Truth.assertThat import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith private typealias DragZoneVerifier = (dragZone: DragZone) -> Unit @SmallTest @EnableFlags(FLAG_ENABLE_BUBBLE_TO_FULLSCREEN, FLAG_ENABLE_CREATE_ANY_BUBBLE) @RunWith(AndroidJUnit4::class) /** Unit tests for [DragZoneFactory]. */ class DragZoneFactoryTest { @get:Rule val flagsRule = SetFlagsRule() private val context = getApplicationContext<Context>() private lateinit var dragZoneFactory: DragZoneFactory private val tabletPortrait = Loading Loading
libs/WindowManager/Shell/multivalentScreenshotTests/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,8 @@ android_test { "truth", "platform-parametric-runner-lib", "platform-screenshot-diff-core", "platform-test-annotations", "platform-test-rules", ], libs: [ "android.test.base.stubs.system", Loading
libs/WindowManager/Shell/multivalentScreenshotTests/src/com/android/wm/shell/shared/bubbles/DragZoneFactoryScreenshotTest.kt +7 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ import android.content.Context import android.graphics.Color import android.graphics.drawable.Drawable import android.graphics.drawable.GradientDrawable import android.platform.test.annotations.EnableFlags import android.platform.test.flag.junit.SetFlagsRule import android.view.View import android.view.WindowManager import android.widget.FrameLayout Loading @@ -29,6 +31,8 @@ import androidx.core.graphics.green import androidx.core.graphics.red import androidx.core.graphics.toColorInt import androidx.test.core.app.ApplicationProvider.getApplicationContext import com.android.wm.shell.Flags.FLAG_ENABLE_BUBBLE_TO_FULLSCREEN import com.android.wm.shell.Flags.FLAG_ENABLE_CREATE_ANY_BUBBLE import com.android.wm.shell.shared.bubbles.DragZoneFactory.BubbleBarPropertiesProvider import com.android.wm.shell.shared.bubbles.DragZoneFactory.DesktopWindowModeChecker import com.android.wm.shell.shared.bubbles.DragZoneFactory.SplitScreenModeChecker Loading @@ -45,6 +49,7 @@ import platform.test.screenshot.ViewScreenshotTestRule import platform.test.screenshot.ViewScreenshotTestRule.Mode import platform.test.screenshot.getEmulatedDevicePathConfig @EnableFlags(FLAG_ENABLE_BUBBLE_TO_FULLSCREEN, FLAG_ENABLE_CREATE_ANY_BUBBLE) @RunWith(ParameterizedAndroidJunit4::class) class DragZoneFactoryScreenshotTest(private val param: Param) { companion object { Loading Loading @@ -108,6 +113,8 @@ class DragZoneFactoryScreenshotTest(private val param: Param) { override fun toString() = "${emulationSpec}_$testName" } @get:Rule val flagsRule = SetFlagsRule() @get:Rule val screenshotRule = ViewScreenshotTestRule( Loading
libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/bubbles/DragZoneFactory.kt +6 −2 Original line number Diff line number Diff line Loading @@ -220,7 +220,9 @@ class DragZoneFactory( is DraggedObject.Bubble -> { dragZones.add(createDismissDragZone()) dragZones.addAll(createBubbleCornerDragZones()) if (BubbleAnythingFlagHelper.enableBubbleToFullscreen()) { dragZones.add(createFullScreenDragZone()) } if (shouldShowDesktopWindowDragZones()) { dragZones.add(createDesktopWindowDragZoneForBubble()) } Loading @@ -228,7 +230,9 @@ class DragZoneFactory( } is DraggedObject.ExpandedView -> { dragZones.add(createDismissDragZone()) if (BubbleAnythingFlagHelper.enableBubbleToFullscreen()) { dragZones.add(createFullScreenDragZone()) } if (shouldShowDesktopWindowDragZones()) { dragZones.add(createDesktopWindowDragZoneForExpandedView()) } Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/shared/bubbles/DragZoneFactoryTest.kt +8 −0 Original line number Diff line number Diff line Loading @@ -19,24 +19,32 @@ package com.android.wm.shell.shared.bubbles import android.content.Context import android.graphics.Insets import android.graphics.Rect import android.platform.test.annotations.EnableFlags import android.platform.test.flag.junit.SetFlagsRule import androidx.test.core.app.ApplicationProvider.getApplicationContext import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.wm.shell.Flags.FLAG_ENABLE_BUBBLE_TO_FULLSCREEN import com.android.wm.shell.Flags.FLAG_ENABLE_CREATE_ANY_BUBBLE import com.android.wm.shell.shared.bubbles.DragZoneFactory.BubbleBarPropertiesProvider import com.android.wm.shell.shared.bubbles.DragZoneFactory.DesktopWindowModeChecker import com.android.wm.shell.shared.bubbles.DragZoneFactory.SplitScreenModeChecker import com.android.wm.shell.shared.bubbles.DragZoneFactory.SplitScreenModeChecker.SplitScreenMode import com.google.common.truth.Truth.assertThat import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith private typealias DragZoneVerifier = (dragZone: DragZone) -> Unit @SmallTest @EnableFlags(FLAG_ENABLE_BUBBLE_TO_FULLSCREEN, FLAG_ENABLE_CREATE_ANY_BUBBLE) @RunWith(AndroidJUnit4::class) /** Unit tests for [DragZoneFactory]. */ class DragZoneFactoryTest { @get:Rule val flagsRule = SetFlagsRule() private val context = getApplicationContext<Context>() private lateinit var dragZoneFactory: DragZoneFactory private val tabletPortrait = Loading