Merge "Removed some ignored tests."
diff --git a/tests/contentcaptureservice/src/android/contentcaptureservice/cts/ChildlessActivityTest.java b/tests/contentcaptureservice/src/android/contentcaptureservice/cts/ChildlessActivityTest.java
index c3f5470..83932d6 100644
--- a/tests/contentcaptureservice/src/android/contentcaptureservice/cts/ChildlessActivityTest.java
+++ b/tests/contentcaptureservice/src/android/contentcaptureservice/cts/ChildlessActivityTest.java
@@ -26,7 +26,6 @@
import static android.contentcaptureservice.cts.Assertions.assertViewWithUnknownParentAppeared;
import static android.contentcaptureservice.cts.Assertions.assertViewsDisappeared;
import static android.contentcaptureservice.cts.Assertions.assertViewsOptionallyDisappeared;
-import static android.contentcaptureservice.cts.Helper.componentNameFor;
import static android.contentcaptureservice.cts.Helper.newImportantView;
import static android.contentcaptureservice.cts.common.ActivitiesWatcher.ActivityLifecycle.DESTROYED;
import static android.contentcaptureservice.cts.common.ActivitiesWatcher.ActivityLifecycle.RESUMED;
@@ -172,44 +171,6 @@
activity2.assertDefaultEvents(session2);
}
- @Ignore("not implemented yet, pending on b/122595322")
- @Test
- public void testLaunchAnotherActivity_serviceDisabledActivity() throws Exception {
- final CtsContentCaptureService service = enableService();
- final ActivityWatcher watcher1 = startWatcher();
-
- // Disable activity 2
- service.setActivityContentCaptureEnabled(componentNameFor(LoginActivity.class), false);
-
- // Launch and finish 1st activity
- final ChildlessActivity activity1 = launchActivity();
- watcher1.waitFor(RESUMED);
- activity1.finish();
- watcher1.waitFor(DESTROYED);
-
- // Launch and finish 2nd activity
- final ActivityLauncher<LoginActivity> anotherActivityLauncher = new ActivityLauncher<>(
- sContext, mActivitiesWatcher, LoginActivity.class);
- final ActivityWatcher watcher2 = anotherActivityLauncher.getWatcher();
- final LoginActivity activity2 = anotherActivityLauncher.launchActivity();
- watcher2.waitFor(RESUMED);
- activity2.finish();
- watcher2.waitFor(DESTROYED);
-
- // Assert the sessions
- final List<ContentCaptureSessionId> sessionIds = service.getAllSessionIds();
- assertThat(sessionIds).hasSize(1);
- final ContentCaptureSessionId sessionId1 = sessionIds.get(0);
- Log.v(TAG, "session id1: " + sessionId1);
-
- final Session session1 = service.getFinishedSession(sessionId1);
- activity1.assertDefaultEvents(session1);
-
- // TODO(b/122595322): should also test events after re-enabling it
- }
-
- // TODO(b/122595322): same tests for disabled by package, explicity whitelisted, etc...
-
@Test
public void testAddAndRemoveNoImportantChild() throws Exception {
final CtsContentCaptureService service = enableService();
diff --git a/tests/contentcaptureservice/src/android/contentcaptureservice/cts/LoginActivityTest.java b/tests/contentcaptureservice/src/android/contentcaptureservice/cts/LoginActivityTest.java
index c189883..824e3eb 100644
--- a/tests/contentcaptureservice/src/android/contentcaptureservice/cts/LoginActivityTest.java
+++ b/tests/contentcaptureservice/src/android/contentcaptureservice/cts/LoginActivityTest.java
@@ -24,7 +24,6 @@
import static android.contentcaptureservice.cts.Assertions.assertViewTextChanged;
import static android.contentcaptureservice.cts.Assertions.assertViewsOptionallyDisappeared;
import static android.contentcaptureservice.cts.Helper.MY_PACKAGE;
-import static android.contentcaptureservice.cts.Helper.componentNameFor;
import static android.contentcaptureservice.cts.Helper.newImportantView;
import static android.contentcaptureservice.cts.common.ActivitiesWatcher.ActivityLifecycle.DESTROYED;
import static android.contentcaptureservice.cts.common.ActivitiesWatcher.ActivityLifecycle.RESUMED;
@@ -52,7 +51,6 @@
import org.junit.After;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import java.util.List;
@@ -208,29 +206,6 @@
);
}
- @Ignore("not implemented yet, pending on b/122595322")
- @Test
- public void testSimpleLifecycle_serviceDisabledActivity() throws Exception {
- final CtsContentCaptureService service = enableService();
- final ActivityWatcher watcher = startWatcher();
-
- // Disable activity
- service.setActivityContentCaptureEnabled(componentNameFor(LoginActivity.class), false);
-
- final LoginActivity activity = launchActivity();
- watcher.waitFor(RESUMED);
-
- activity.finish();
- watcher.waitFor(DESTROYED);
-
- final List<ContentCaptureSessionId> sessionIds = service.getAllSessionIds();
- assertThat(sessionIds).isEmpty();
-
- // TODO(b/122595322): should also test events after re-enabling it
- }
-
- // TODO(b/122595322): same tests for disabled by package, explicity whitelisted, etc...
-
@Test
public void testTextChanged() throws Exception {
final CtsContentCaptureService service = enableService();
@@ -441,51 +416,6 @@
assertThat(events).isEmpty();
}
- @Ignore("not implemented yet, pending on b/122595322")
- @Test
- public void testDisabledByFlagSecureAndService() throws Exception {
- final CtsContentCaptureService service = enableService();
- final ActivityWatcher watcher = startWatcher();
-
- LoginActivity.onRootView((activity, rootView) -> activity.getWindow()
- .addFlags(WindowManager.LayoutParams.FLAG_SECURE));
-
- // Disable activity
- service.setActivityContentCaptureEnabled(componentNameFor(LoginActivity.class), false);
-
- final LoginActivity activity = launchActivity();
- watcher.waitFor(RESUMED);
-
- activity.finish();
- watcher.waitFor(DESTROYED);
-
- final List<ContentCaptureSessionId> sessionIds = service.getAllSessionIds();
- assertThat(sessionIds).isEmpty();
- }
-
- @Ignore("not implemented yet, pending on b/122595322")
- @Test
- public void testDisabledByAppAndAndService() throws Exception {
- final CtsContentCaptureService service = enableService();
- final ActivityWatcher watcher = startWatcher();
-
- LoginActivity.onRootView((activity, rootView) -> activity.getContentCaptureManager()
- .setContentCaptureEnabled(false));
-
- // Disable activity
- service.setActivityContentCaptureEnabled(componentNameFor(LoginActivity.class), false);
-
- final LoginActivity activity = launchActivity();
- watcher.waitFor(RESUMED);
-
- assertThat(activity.getContentCaptureManager().isContentCaptureEnabled()).isFalse();
-
- activity.finish();
- watcher.waitFor(DESTROYED);
-
- final List<ContentCaptureSessionId> sessionIds = service.getAllSessionIds();
- }
-
@Test
public void testUserDataRemovalRequest_forEverything() throws Exception {
final CtsContentCaptureService service = enableService();