Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(512)

Unified Diff: ios/chrome/browser/ui/fullscreen_egtest.mm

Issue 2798773002: Create ChromeEarlGrey waitForWebViewContainingText. (Closed)
Patch Set: review comments Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/fullscreen_egtest.mm
diff --git a/ios/chrome/browser/ui/fullscreen_egtest.mm b/ios/chrome/browser/ui/fullscreen_egtest.mm
index b61d9810b9d4ce8c395e931d87be8d1da4aacda0..adc1fc42e4704bc8aa4e25624b4cdaaa9bda69a2 100644
--- a/ios/chrome/browser/ui/fullscreen_egtest.mm
+++ b/ios/chrome/browser/ui/fullscreen_egtest.mm
@@ -77,14 +77,6 @@ void AssertURLIs(const GURL& expectedURL) {
GREYAssert(testing::WaitUntilConditionOrTimeout(1.0, condition), description);
}
-// Asserts that the current web view containers contains |text|.
-void AssertStringIsPresentOnPage(const std::string& text) {
- id<GREYMatcher> response_matcher =
- chrome_test_util::WebViewContainingText(text);
- [[EarlGrey selectElementWithMatcher:response_matcher]
- assertWithMatcher:grey_notNil()];
-}
-
} // namespace
#pragma mark - Tests
@@ -170,8 +162,7 @@ void AssertStringIsPresentOnPage(const std::string& text) {
- (void)testChromeToChromeURLKeepsHeaderOnScreen {
const GURL kChromeAboutURL("chrome://chrome-urls");
[ChromeEarlGrey loadURL:kChromeAboutURL];
-
- AssertStringIsPresentOnPage("chrome://version");
+ [ChromeEarlGrey waitForWebViewContainingText:"chrome://version"];
// Hide the toolbar. The page is not long enough to dismiss the toolbar using
// the UI so we have to zoom in.
@@ -250,7 +241,7 @@ void AssertStringIsPresentOnPage(const std::string& text) {
web::test::SetUpSimpleHttpServer(responses);
[ChromeEarlGrey loadURL:URL];
- AssertStringIsPresentOnPage("Tall page");
+ [ChromeEarlGrey waitForWebViewContainingText:"Tall page"];
// Hide the toolbar.
HideToolbarUsingUI();
@@ -290,7 +281,7 @@ void AssertStringIsPresentOnPage(const std::string& text) {
chrome_test_util::SetContentSettingsBlockPopups(CONTENT_SETTING_ALLOW);
[ChromeEarlGrey loadURL:URL];
- AssertStringIsPresentOnPage("link1");
+ [ChromeEarlGrey waitForWebViewContainingText:"link1"];
chrome_test_util::AssertMainTabCount(1);
// Hide the toolbar.
@@ -301,7 +292,7 @@ void AssertStringIsPresentOnPage(const std::string& text) {
chrome_test_util::TapWebViewElementWithId("link1");
// Check that a new Tab was created.
- AssertStringIsPresentOnPage("link2");
+ [ChromeEarlGrey waitForWebViewContainingText:"link2"];
chrome_test_util::AssertMainTabCount(2);
AssertURLIs(destinationURL);
@@ -312,7 +303,7 @@ void AssertStringIsPresentOnPage(const std::string& text) {
// Close the tab.
chrome_test_util::TapWebViewElementWithId("link2");
- AssertStringIsPresentOnPage("link1");
+ [ChromeEarlGrey waitForWebViewContainingText:"link1"];
// Make sure the toolbar is on the screen.
chrome_test_util::AssertMainTabCount(1);
@@ -343,14 +334,14 @@ void AssertStringIsPresentOnPage(const std::string& text) {
[ChromeEarlGrey loadURL:originURL];
- AssertStringIsPresentOnPage("link1");
+ [ChromeEarlGrey waitForWebViewContainingText:"link1"];
// Dismiss the toolbar.
HideToolbarUsingUI();
[ChromeEarlGreyUI waitForToolbarVisible:NO];
// Navigate to the other page.
chrome_test_util::TapWebViewElementWithId("link1");
- AssertStringIsPresentOnPage("link2");
+ [ChromeEarlGrey waitForWebViewContainingText:"link2"];
// Make sure toolbar is shown since a new load has started.
[ChromeEarlGreyUI waitForToolbarVisible:YES];
@@ -380,7 +371,7 @@ void AssertStringIsPresentOnPage(const std::string& text) {
web::test::SetUpSimpleHttpServer(responses);
[ChromeEarlGrey loadURL:URL];
- AssertStringIsPresentOnPage("link");
+ [ChromeEarlGrey waitForWebViewContainingText:"link"];
// Dismiss the toolbar.
HideToolbarUsingUI();
« no previous file with comments | « ios/chrome/browser/ui/find_bar/find_in_page_egtest.mm ('k') | ios/chrome/browser/ui/history/history_ui_egtest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698