diff options
author | 2025-03-14 00:52:13 +0000 | |
---|---|---|
committer | 2025-03-14 00:52:13 +0000 | |
commit | 53e2b86b6981e256966c86179cb458e556aae0bd (patch) | |
tree | c1d4939970b542d740d218ed2175203be771a704 /tests | |
parent | 595ae7b5cb5550b63fa29d1a2e664e4ea8101ed2 (diff) |
[DocsUI, Search]: Adds tests for SearchV2.
This CL creates 2 private method that hold test body and calls them from
4 different tests with the mix of search_v2_read_only disabled and
enabled.
Bug: 380988442
Test: m DocumentsUIGoogle
Flag: com.android.documentsui.flags.use_search_v2_read_only
Change-Id: Id5f3f49f44bd9c06d122e6a68065a1b04cc57a17
Diffstat (limited to 'tests')
-rw-r--r-- | tests/functional/com/android/documentsui/FilesActivityUiTest.java | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/tests/functional/com/android/documentsui/FilesActivityUiTest.java b/tests/functional/com/android/documentsui/FilesActivityUiTest.java index f1f505235..6c2397068 100644 --- a/tests/functional/com/android/documentsui/FilesActivityUiTest.java +++ b/tests/functional/com/android/documentsui/FilesActivityUiTest.java @@ -17,11 +17,14 @@ package com.android.documentsui; import static com.android.documentsui.flags.Flags.FLAG_HIDE_ROOTS_ON_DESKTOP_RO; +import static com.android.documentsui.flags.Flags.FLAG_USE_SEARCH_V2_READ_ONLY; +import static com.android.documentsui.flags.Flags.FLAG_USE_MATERIAL3; import android.app.Instrumentation; import android.net.Uri; import android.os.RemoteException; import android.platform.test.annotations.RequiresFlagsDisabled; +import android.platform.test.annotations.RequiresFlagsEnabled; import android.platform.test.flag.junit.CheckFlagsRule; import android.platform.test.flag.junit.DeviceFlagsValueProvider; @@ -92,13 +95,23 @@ public class FilesActivityUiTest extends ActivityTestJunit4<FilesActivity> { bots.main.assertWindowTitle("Images"); } + private void filesListed() throws Exception { + bots.directory.assertDocumentsPresent("file0.log", "file1.png", "file2.csv"); + } + @Test + @RequiresFlagsDisabled(FLAG_USE_SEARCH_V2_READ_ONLY) public void testFilesListed() throws Exception { - bots.directory.assertDocumentsPresent("file0.log", "file1.png", "file2.csv"); + filesListed(); } @Test - public void testFilesList_LiveUpdate() throws Exception { + @RequiresFlagsEnabled({FLAG_USE_SEARCH_V2_READ_ONLY, FLAG_USE_MATERIAL3}) + public void testFilesListed_searchV2() throws Exception { + filesListed(); + } + + private void filesListed_LiveUpdates() throws Exception { mDocsHelper.createDocument(rootDir0, "yummers/sandwich", "Ham & Cheese.sandwich"); bots.directory.waitForDocument("Ham & Cheese.sandwich"); @@ -107,6 +120,18 @@ public class FilesActivityUiTest extends ActivityTestJunit4<FilesActivity> { } @Test + @RequiresFlagsDisabled(FLAG_USE_SEARCH_V2_READ_ONLY) + public void testFilesList_LiveUpdate() throws Exception { + filesListed_LiveUpdates(); + } + + @Test + @RequiresFlagsEnabled({FLAG_USE_SEARCH_V2_READ_ONLY, FLAG_USE_MATERIAL3}) + public void testFilesList_LiveUpdate_searchV2() throws Exception { + filesListed_LiveUpdates(); + } + + @Test public void testNavigate_byBreadcrumb() throws Exception { bots.directory.openDocument(dirName1); bots.directory.waitForDocument(childDir1); // wait for known content |