Chromium Code Reviews| 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..b1a26f5c35155d45ed222a8a3844ec14e177f0a7 |
| --- /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 on timeout or if unrecoverable error |
|
baxley
2016/09/14 15:43:26
Should we clarify that it fails with a GREYAssert,
Eugene But (OOO till 7-30)
2016/09/14 16:25:29
Done.
|
| +// (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. |
|
baxley
2016/09/14 15:43:26
Similar to the last comment, do you think it's goo
Eugene But (OOO till 7-30)
2016/09/14 16:25:29
Done.
|
| +id ExecuteJavaScript(WebState* web_state, |
| + NSString* javascript, |
| + NSError** out_error); |
| + |
| +} // namespace web |
| + |
| +#endif // IOS_WEB_PUBLIC_TEST_EARL_GREY_JS_TEST_UTIL_H_ |