Merge "Refactor flickerlib dependencies"
This commit is contained in:
committed by
Android (Google) Code Review
commit
8d77cf0a06
@@ -18,7 +18,7 @@ android_test {
|
||||
name: "WMShellFlickerTests",
|
||||
srcs: ["src/**/*.java", "src/**/*.kt"],
|
||||
manifest: "AndroidManifest.xml",
|
||||
test_config: "AndroidTest.xml",
|
||||
test_config: "AndroidTestPhysicalDevices.xml",
|
||||
platform_apis: true,
|
||||
certificate: "platform",
|
||||
test_suites: ["device-tests"],
|
||||
@@ -32,3 +32,21 @@ android_test {
|
||||
"launcher-aosp-tapl"
|
||||
],
|
||||
}
|
||||
|
||||
android_test {
|
||||
name: "WMShellFlickerTestsVirtual",
|
||||
srcs: ["src/**/*.java", "src/**/*.kt"],
|
||||
manifest: "AndroidManifest.xml",
|
||||
test_config: "AndroidTestVirtualDevices.xml",
|
||||
platform_apis: true,
|
||||
certificate: "platform",
|
||||
libs: ["android.test.runner"],
|
||||
static_libs: [
|
||||
"androidx.test.ext.junit",
|
||||
"flickerlib",
|
||||
"truth-prebuilt",
|
||||
"app-helpers-core",
|
||||
"launcher-helper-lib",
|
||||
"launcher-aosp-tapl"
|
||||
],
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
</target_preparer>
|
||||
<test class="com.android.tradefed.testtype.AndroidJUnitTest">
|
||||
<option name="package" value="com.android.wm.shell.flicker"/>
|
||||
<option name="include-annotation" value="androidx.test.filters.RequiresDevice" />
|
||||
<option name="exclude-annotation" value="androidx.test.filters.FlakyTest" />
|
||||
<option name="shell-timeout" value="6600s" />
|
||||
<option name="test-timeout" value="6000s" />
|
||||
@@ -37,4 +38,4 @@
|
||||
<option name="collect-on-run-ended-only" value="true" />
|
||||
<option name="clean-up" value="true" />
|
||||
</metrics_collector>
|
||||
</configuration>
|
||||
</configuration>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
* Copyright 2020 Google Inc. All Rights Reserved.
|
||||
-->
|
||||
<configuration description="Runs WindowManager Shell Flicker Tests">
|
||||
<option name="test-tag" value="FlickerTests" />
|
||||
<target_preparer class="com.android.tradefed.targetprep.DeviceSetup">
|
||||
<!-- keeps the screen on during tests -->
|
||||
<option name="screen-always-on" value="on" />
|
||||
<!-- prevents the phone from restarting -->
|
||||
<option name="force-skip-system-props" value="true" />
|
||||
<!-- set WM tracing verbose level to all -->
|
||||
<option name="run-command" value="cmd window tracing level all" />
|
||||
<!-- inform WM to log all transactions -->
|
||||
<option name="run-command" value="cmd window tracing transaction" />
|
||||
<!-- restart launcher to activate TAPL -->
|
||||
<option name="run-command" value="setprop ro.test_harness 1 ; am force-stop com.google.android.apps.nexuslauncher" />
|
||||
</target_preparer>
|
||||
<target_preparer class="com.android.tradefed.targetprep.DeviceCleaner">
|
||||
<!-- reboot the device to teardown any crashed tests -->
|
||||
<option name="cleanup-action" value="REBOOT" />
|
||||
</target_preparer>
|
||||
<target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
|
||||
<option name="cleanup-apks" value="true"/>
|
||||
<option name="test-file-name" value="WMShellFlickerTests.apk"/>
|
||||
<option name="test-file-name" value="WMShellFlickerTestApp.apk" />
|
||||
</target_preparer>
|
||||
<test class="com.android.tradefed.testtype.AndroidJUnitTest">
|
||||
<option name="package" value="com.android.wm.shell.flicker"/>
|
||||
<option name="exclude-annotation" value="androidx.test.filters.RequiresDevice" />
|
||||
<option name="exclude-annotation" value="androidx.test.filters.FlakyTest" />
|
||||
<option name="shell-timeout" value="6600s" />
|
||||
<option name="test-timeout" value="6000s" />
|
||||
<option name="hidden-api-checks" value="false" />
|
||||
</test>
|
||||
<metrics_collector class="com.android.tradefed.device.metric.FilePullerLogCollector">
|
||||
<option name="directory-keys" value="/storage/emulated/0/Android/data/com.android.wm.shell.flicker/files" />
|
||||
<option name="collect-on-run-ended-only" value="true" />
|
||||
<option name="clean-up" value="true" />
|
||||
</metrics_collector>
|
||||
</configuration>
|
||||
@@ -18,7 +18,7 @@ package com.android.wm.shell.flicker.helpers
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.support.test.launcherhelper.ILauncherStrategy
|
||||
import com.android.server.wm.flicker.StandardAppHelper
|
||||
import com.android.server.wm.flicker.helpers.StandardAppHelper
|
||||
|
||||
abstract class FlickerAppHelper(
|
||||
instr: Instrumentation,
|
||||
|
||||
@@ -18,7 +18,7 @@ package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
import androidx.test.filters.LargeTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.dsl.flicker
|
||||
import com.android.server.wm.flicker.helpers.closePipWindow
|
||||
import com.android.server.wm.flicker.helpers.expandPipWindow
|
||||
@@ -41,7 +41,7 @@ import org.junit.runners.Parameterized
|
||||
* Test Pip launch.
|
||||
* To run this test: `atest FlickerTests:PipToAppTest`
|
||||
*/
|
||||
@LargeTest
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@FlakyTest(bugId = 152738416)
|
||||
|
||||
@@ -28,7 +28,6 @@ android_test {
|
||||
"flickertestapplib",
|
||||
"flickerlib",
|
||||
"truth-prebuilt",
|
||||
"app-helpers-core",
|
||||
"launcher-helper-lib",
|
||||
"launcher-aosp-tapl"
|
||||
],
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 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.server.wm.flicker.helpers
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.support.test.launcherhelper.ILauncherStrategy
|
||||
import com.android.server.wm.flicker.StandardAppHelper
|
||||
|
||||
abstract class FlickerAppHelper(
|
||||
instr: Instrumentation,
|
||||
launcherName: String,
|
||||
launcherStrategy: ILauncherStrategy
|
||||
) : StandardAppHelper(instr, sFlickerPackage, launcherName, launcherStrategy) {
|
||||
companion object {
|
||||
var sFlickerPackage = "com.android.server.wm.flicker.testapp"
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@ open class ImeAppHelper(
|
||||
launcherStrategy: ILauncherStrategy = LauncherStrategyFactory
|
||||
.getInstance(instr)
|
||||
.launcherStrategy
|
||||
) : FlickerAppHelper(instr, launcherName, launcherStrategy) {
|
||||
) : StandardAppHelper(instr, launcherName, launcherStrategy) {
|
||||
open fun openIME(device: UiDevice) {
|
||||
val editText = device.wait(
|
||||
Until.findObject(By.res(getPackage(), "plain_text_input")),
|
||||
|
||||
@@ -28,7 +28,7 @@ class PipAppHelper(
|
||||
launcherStrategy: ILauncherStrategy = LauncherStrategyFactory
|
||||
.getInstance(instr)
|
||||
.launcherStrategy
|
||||
) : FlickerAppHelper(instr, "PipApp", launcherStrategy) {
|
||||
) : StandardAppHelper(instr, "PipApp", launcherStrategy) {
|
||||
fun clickEnterPipButton(device: UiDevice) {
|
||||
val enterPipButton = device.findObject(By.res(getPackage(), "enter_pip"))
|
||||
Assert.assertNotNull("Pip button not found, this usually happens when the device " +
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package com.android.server.wm.flicker.launch
|
||||
|
||||
import com.android.server.wm.flicker.NonRotationTestBase
|
||||
import com.android.server.wm.flicker.StandardAppHelper
|
||||
import com.android.server.wm.flicker.helpers.StandardAppHelper
|
||||
import com.android.server.wm.flicker.dsl.LayersAssertion
|
||||
import com.android.server.wm.flicker.dsl.WmAssertion
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ package com.android.server.wm.flicker.launch
|
||||
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.StandardAppHelper
|
||||
import com.android.server.wm.flicker.helpers.StandardAppHelper
|
||||
import com.android.server.wm.flicker.dsl.flicker
|
||||
import com.android.server.wm.flicker.focusChanges
|
||||
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
|
||||
|
||||
@@ -20,7 +20,7 @@ import androidx.test.filters.RequiresDevice
|
||||
import android.view.Surface
|
||||
import com.android.server.wm.flicker.NonRotationTestBase.Companion.SCREENSHOT_LAYER
|
||||
import com.android.server.wm.flicker.RotationTestBase
|
||||
import com.android.server.wm.flicker.StandardAppHelper
|
||||
import com.android.server.wm.flicker.helpers.StandardAppHelper
|
||||
import com.android.server.wm.flicker.dsl.flicker
|
||||
import com.android.server.wm.flicker.focusDoesNotChange
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
|
||||
@@ -19,7 +19,7 @@ package com.android.server.wm.flicker.splitscreen
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.NonRotationTestBase
|
||||
import com.android.server.wm.flicker.StandardAppHelper
|
||||
import com.android.server.wm.flicker.helpers.StandardAppHelper
|
||||
import com.android.server.wm.flicker.dsl.flicker
|
||||
import com.android.server.wm.flicker.focusChanges
|
||||
import com.android.server.wm.flicker.helpers.exitSplitScreen
|
||||
|
||||
@@ -24,7 +24,7 @@ import androidx.test.filters.FlakyTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import androidx.test.uiautomator.By
|
||||
import com.android.server.wm.flicker.FlickerTestBase
|
||||
import com.android.server.wm.flicker.StandardAppHelper
|
||||
import com.android.server.wm.flicker.helpers.StandardAppHelper
|
||||
import com.android.server.wm.flicker.dsl.flicker
|
||||
import com.android.server.wm.flicker.focusDoesNotChange
|
||||
import com.android.server.wm.flicker.helpers.ImeAppHelper
|
||||
|
||||
@@ -19,7 +19,7 @@ package com.android.server.wm.flicker.splitscreen
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.NonRotationTestBase
|
||||
import com.android.server.wm.flicker.StandardAppHelper
|
||||
import com.android.server.wm.flicker.helpers.StandardAppHelper
|
||||
import com.android.server.wm.flicker.dsl.flicker
|
||||
import com.android.server.wm.flicker.focusDoesNotChange
|
||||
import com.android.server.wm.flicker.helpers.exitSplitScreen
|
||||
|
||||
Reference in New Issue
Block a user