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

Unified Diff: ios/web/public/test/earl_grey/js_test_util.h

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/BUILD.gn ('k') | ios/web/public/test/earl_grey/js_test_util.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/public/test/earl_grey/js_test_util.h
diff --git a/ios/web/public/test/earl_grey/js_test_util.h b/ios/web/public/test/earl_grey/js_test_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..6e07fe8bded3a5418611f322690782003670fa34
--- /dev/null
+++ b/ios/web/public/test/earl_grey/js_test_util.h
@@ -0,0 +1,30 @@
+// 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.
+
+#ifndef IOS_WEB_PUBLIC_TEST_EARL_GREY_JS_TEST_UTIL_H_
+#define IOS_WEB_PUBLIC_TEST_EARL_GREY_JS_TEST_UTIL_H_
+
+#import <Foundation/Foundation.h>
+
+#import "ios/web/public/web_state/web_state.h"
+
+namespace web {
+
+// Waits until the Window ID has been injected and the page is thus ready to
+// respond to JavaScript injection. Fails with a GREYAssert on timeout or if
+// unrecoverable error (such as no web view) occurs.
+void WaitUntilWindowIdInjected(WebState* web_state);
+
+// Executes |javascript| on the given |web_state|, and waits until execution is
+// completed. If |out_error| is not nil, it is set to the error resulting from
+// the execution, if one occurs. The return value is the result of the
+// JavaScript execution. If the script execution is timed out, then this method
+// fails with a GREYAssert.
+id ExecuteJavaScript(WebState* web_state,
+ NSString* javascript,
+ NSError** out_error);
+
+} // namespace web
+
+#endif // IOS_WEB_PUBLIC_TEST_EARL_GREY_JS_TEST_UTIL_H_
« no previous file with comments | « ios/web/BUILD.gn ('k') | ios/web/public/test/earl_grey/js_test_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698