summaryrefslogtreecommitdiff
path: root/tests/hostside
diff options
context:
space:
mode:
author Tyler Dewey <deweytyl@google.com> 2022-12-23 21:27:46 +0000
committer Tyler Dewey <deweytyl@google.com> 2023-01-09 16:39:15 +0000
commit5ce08384f969cafedf6187fcc036e1210b1f7486 (patch)
tree9cc4565066c9c7e0fc5342bd214fab749f285d2f /tests/hostside
parent86a064498845fa2e781f804f92f4ec07461e6123 (diff)
Extract shared SafetyCenter testing lib, use in Logging tests.
Bug: 239682646 Test: atest SafetyCenterHostSideTestCases CtsSafetyCenterTestCases Relnote: N/A Change-Id: I3120f3a7dd8b51a718b076ff0b4be87c31b76dbf
Diffstat (limited to 'tests/hostside')
-rw-r--r--tests/hostside/safetycenter/AndroidTest.xml2
-rw-r--r--tests/hostside/safetycenter/OWNERS3
-rw-r--r--tests/hostside/safetycenter/helper-app/Android.bp2
-rw-r--r--tests/hostside/safetycenter/helper-app/src/android/safetycenter/hostside/device/SafetyCenterInteractionLoggingHelperTests.kt14
4 files changed, 6 insertions, 15 deletions
diff --git a/tests/hostside/safetycenter/AndroidTest.xml b/tests/hostside/safetycenter/AndroidTest.xml
index 310ef9d04..09ddf9d84 100644
--- a/tests/hostside/safetycenter/AndroidTest.xml
+++ b/tests/hostside/safetycenter/AndroidTest.xml
@@ -19,8 +19,6 @@
<option name="config-descriptor:metadata" key="component" value="framework"/>
<option name="config-descriptor:metadata" key="parameter" value="not_instant_app"/>
<option name="config-descriptor:metadata" key="parameter" value="not_multi_abi"/>
- <!-- Multi-user code is tested separately using Bedstead. See SafetyCenterMultiUsersTest. -->
- <option name="config-descriptor:metadata" key="parameter" value="not_secondary_user"/>
<object class="com.android.tradefed.testtype.suite.module.Sdk33ModuleController"
type="module_controller"/>
diff --git a/tests/hostside/safetycenter/OWNERS b/tests/hostside/safetycenter/OWNERS
new file mode 100644
index 000000000..5d8b8161b
--- /dev/null
+++ b/tests/hostside/safetycenter/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 1026964
+
+include /SafetyCenter/OWNERS
diff --git a/tests/hostside/safetycenter/helper-app/Android.bp b/tests/hostside/safetycenter/helper-app/Android.bp
index 851b14795..cf4372d99 100644
--- a/tests/hostside/safetycenter/helper-app/Android.bp
+++ b/tests/hostside/safetycenter/helper-app/Android.bp
@@ -30,6 +30,6 @@ android_test_helper_app {
static_libs: [
"androidx.test.rules",
"androidx.test.ext.junit",
- "compatibility-device-util-axt",
+ "safety-center-test-util-lib",
],
} \ No newline at end of file
diff --git a/tests/hostside/safetycenter/helper-app/src/android/safetycenter/hostside/device/SafetyCenterInteractionLoggingHelperTests.kt b/tests/hostside/safetycenter/helper-app/src/android/safetycenter/hostside/device/SafetyCenterInteractionLoggingHelperTests.kt
index ef5326911..f8faf89bc 100644
--- a/tests/hostside/safetycenter/helper-app/src/android/safetycenter/hostside/device/SafetyCenterInteractionLoggingHelperTests.kt
+++ b/tests/hostside/safetycenter/helper-app/src/android/safetycenter/hostside/device/SafetyCenterInteractionLoggingHelperTests.kt
@@ -17,10 +17,9 @@
package android.safetycenter.hostside.device
import android.content.Context
-import android.content.Intent
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
-import com.android.compatibility.common.util.UiAutomatorUtils2
+import com.android.safetycenter.testing.SafetyCenterActivityLauncher.launchSafetyCenterActivity
import org.junit.Test
import org.junit.runner.RunWith
@@ -40,15 +39,6 @@ class SafetyCenterInteractionLoggingHelperTests {
@Test
fun openSafetyCenter() {
- context.startActivity(
- Intent(Intent.ACTION_SAFETY_CENTER)
- .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
- .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK))
-
- // TODO(b/239682646): Use the extracted CTS support library to launch and close activity
- // (after extracting it)
- val uiDevice = UiAutomatorUtils2.getUiDevice()
- uiDevice.waitForIdle()
- uiDevice.pressBack()
+ context.launchSafetyCenterActivity {}
}
}