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

Unified Diff: ios/web/shell/test/earl_grey/shell_earl_grey.mm

Issue 2340533004: [ios] Implemented -[ShellEarlGrey loadURL:]. (Closed)
Patch Set: Addressed review comments 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/earl_grey/shell_earl_grey.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/shell/test/earl_grey/shell_earl_grey.mm
diff --git a/ios/web/shell/test/earl_grey/shell_earl_grey.mm b/ios/web/shell/test/earl_grey/shell_earl_grey.mm
new file mode 100644
index 0000000000000000000000000000000000000000..63c7552ae0e31b1609f855064b95da29acdd077f
--- /dev/null
+++ b/ios/web/shell/test/earl_grey/shell_earl_grey.mm
@@ -0,0 +1,38 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "ios/web/shell/test/earl_grey/shell_earl_grey.h"
+
+#import <EarlGrey/EarlGrey.h>
+
+#import "ios/web/public/test/earl_grey/js_test_util.h"
+#include "ios/web/shell/test/app/navigation_test_util.h"
+#import "ios/web/shell/test/app/web_shell_test_util.h"
+
+namespace {
+const NSTimeInterval kWaitForPageLoadTimeout = 10.0;
+} // namespace
+
+@implementation ShellEarlGrey
+
++ (void)loadURL:(const GURL&)URL {
+ web::shell_test_util::LoadUrl(URL);
+
+ // Make sure that the page started loading.
+ GREYAssert(web::shell_test_util::IsLoading(), @"Page did not start loading.");
+
+ GREYCondition* condition =
+ [GREYCondition conditionWithName:@"Wait for page to complete loading."
+ block:^BOOL {
+ return !web::shell_test_util::IsLoading();
+ }];
+ GREYAssert([condition waitWithTimeout:kWaitForPageLoadTimeout],
+ @"Page did not complete loading.");
+
+ web::WebState* webState = web::shell_test_util::GetCurrentWebState();
+ if (webState->ContentIsHTML())
+ web::WaitUntilWindowIdInjected(webState);
+}
+
+@end
« no previous file with comments | « ios/web/shell/test/earl_grey/shell_earl_grey.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698