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

Unified Diff: ios/web/shell/test/page_state_egtest.mm

Issue 2343453002: [ios] Use +[ShellEarlGrey loadURL:] for page loading in EG tests. (Closed)
Patch Set: Rebased Created 4 years, 3 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
« no previous file with comments | « ios/web/shell/test/navigation_egtest.mm ('k') | ios/web/shell/test/pdf_egtest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/shell/test/page_state_egtest.mm
diff --git a/ios/web/shell/test/page_state_egtest.mm b/ios/web/shell/test/page_state_egtest.mm
index f60215c12d900a3c72ca156b38bf8fc97d0bb085..41f513e3562235eeceab20cf30ba2aa211395372 100644
--- a/ios/web/shell/test/page_state_egtest.mm
+++ b/ios/web/shell/test/page_state_egtest.mm
@@ -9,8 +9,8 @@
#import "ios/web/public/test/http_server.h"
#include "ios/web/public/test/http_server_util.h"
-#include "ios/web/shell/test/app/navigation_test_util.h"
#import "ios/web/shell/test/earl_grey/shell_base_test_case.h"
+#import "ios/web/shell/test/earl_grey/shell_earl_grey.h"
#import "ios/web/shell/test/earl_grey/shell_matchers.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
@@ -47,9 +47,7 @@ id<GREYMatcher> contentOffset(CGPoint offset) {
} // namespace
-using web::shell_test_util::LoadUrl;
using web::test::HttpServer;
-using web::webViewContainingText;
// Page state test cases for the web shell.
@interface PageStateTestCase : ShellBaseTestCase
@@ -63,11 +61,7 @@ using web::webViewContainingText;
web::test::SetUpFileBasedHttpServer();
// Load first URL which is a long page.
- LoadUrl(HttpServer::MakeUrl(kLongPage1));
- // TODO(crbug.com/629116): Remove this once |LoadUrl| waits for the load
- // completion.
- [[EarlGrey selectElementWithMatcher:webViewContainingText("List of numbers")]
- assertWithMatcher:grey_notNil()];
+ [ShellEarlGrey loadURL:HttpServer::MakeUrl(kLongPage1)];
// Scroll the first page and verify the offset.
[[EarlGrey selectElementWithMatcher:web::webViewScrollView()]
@@ -76,14 +70,7 @@ using web::webViewContainingText;
assertWithMatcher:contentOffset(CGPointMake(0, kScrollOffset1))];
// Load second URL, which is also a long page.
- GURL URL2 = HttpServer::MakeUrl(kLongPage2);
- LoadUrl(URL2);
- // TODO(crbug.com/629116): Remove these once |LoadUrl| waits for the load
- // completion.
- [[EarlGrey selectElementWithMatcher:web::addressFieldText(URL2.spec())]
- assertWithMatcher:grey_notNil()];
- [[EarlGrey selectElementWithMatcher:webViewContainingText("List of numbers")]
- assertWithMatcher:grey_notNil()];
+ [ShellEarlGrey loadURL:HttpServer::MakeUrl(kLongPage2)];
// Scroll the second page and verify the offset.
[[EarlGrey selectElementWithMatcher:web::webViewScrollView()]
« no previous file with comments | « ios/web/shell/test/navigation_egtest.mm ('k') | ios/web/shell/test/pdf_egtest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698