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

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

Issue 2798773002: Create ChromeEarlGrey waitForWebViewContainingText. (Closed)
Patch Set: better formatting Created 3 years, 8 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 550cc494f93827054280397d8c29c3d3fcff2fdf..5194f38d5fa3b8c945ad4dcb0bbca8a06ed56e83 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
@@ -165,8 +157,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.
@@ -245,7 +236,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();
@@ -285,7 +276,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.
@@ -296,7 +287,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);
@@ -307,7 +298,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);
@@ -338,14 +329,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];
@@ -375,7 +366,7 @@ void AssertStringIsPresentOnPage(const std::string& text) {
web::test::SetUpSimpleHttpServer(responses);
[ChromeEarlGrey loadURL:URL];
- AssertStringIsPresentOnPage("link");
+ [ChromeEarlGrey waitForWebViewContainingText:@"link"];
// Dismiss the toolbar.
HideToolbarUsingUI();

Powered by Google App Engine
This is Rietveld 408576698