Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5fbd42c3 authored by Fedor Tsarev's avatar Fedor Tsarev Committed by Android (Google) Code Review
Browse files

Revert "DocsUI: Fix assertWindowTitle() for pre-material3"

This reverts commit 738a7e87.

Reason for revert: potential culprit for b/430509546 some git_main builds are failing

Bug: 429356725
Bug: 430509546
Change-Id: I5c9b77885ad79bbec7bf9154c881814541486ba0
parent 738a7e87
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.withClassName;
import static androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withSubstring;
import static androidx.test.espresso.matcher.ViewMatchers.withText;

import static com.android.documentsui.util.FlagUtils.isUseMaterial3FlagEnabled;
@@ -117,15 +116,8 @@ public class UiBot extends Bots.BaseBot {
    }

    public void assertWindowTitle(String expected) {
        mDevice.waitForIdle(mTimeout);
        if (FlagUtils.isUseMaterial3FlagEnabled()) {
            onView(TOOLBAR).check(matches(withToolbarTitle(is(expected))));
            return;
        }
        // For pre-m3, the title might not be visible in the toolbar, when `show_search_bar` is
        // true, because instead it might display the search bar for narrow screens (phones).
        // Let's check the `header_title` instead. NOTE: header_title doesn't exist in m3.
        onView(withId(R.id.header_title)).check(matches(withSubstring(expected)));
        onView(TOOLBAR)
                .check(matches(withToolbarTitle(is(expected))));
    }

    /**
+2 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import com.android.documentsui.files.FilesActivity;
import com.android.documentsui.filters.HugeLongTest;
import com.android.documentsui.rules.TestFilesRule;

import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;

@@ -88,6 +89,7 @@ public class SidebarUiTest extends ActivityTestJunit4<FilesActivity> {
        bots.directory.waitForDocument("file1.log");
    }

    @Ignore
    @Test
    public void testOpenInNewWindow_preservesFiles() throws Exception {
        // Select Recents in the existing window and open ROOT_0 in the new window so we can