| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "ios/web/public/test/earl_grey/js_test_util.h" | 5 #import "ios/web/public/test/earl_grey/js_test_util.h" |
| 6 | 6 |
| 7 #import <EarlGrey/EarlGrey.h> | 7 #import <EarlGrey/EarlGrey.h> |
| 8 #import <WebKit/WebKit.h> | 8 #import <WebKit/WebKit.h> |
| 9 | 9 |
| 10 #include "base/timer/elapsed_timer.h" | 10 #include "base/timer/elapsed_timer.h" |
| 11 #import "ios/testing/earl_grey/wait_util.h" | 11 #import "ios/testing/wait_util.h" |
| 12 #import "ios/web/public/web_state/js/crw_js_injection_receiver.h" | 12 #import "ios/web/public/web_state/js/crw_js_injection_receiver.h" |
| 13 | 13 |
| 14 namespace web { | 14 namespace web { |
| 15 | 15 |
| 16 void WaitUntilWindowIdInjected(WebState* web_state) { | 16 void WaitUntilWindowIdInjected(WebState* web_state) { |
| 17 bool is_window_id_injected = false; | 17 bool is_window_id_injected = false; |
| 18 bool is_timeout = false; | 18 bool is_timeout = false; |
| 19 bool is_unrecoverable_error = false; | 19 bool is_unrecoverable_error = false; |
| 20 | 20 |
| 21 base::ElapsedTimer timer; | 21 base::ElapsedTimer timer; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 }]; | 62 }]; |
| 63 GREYAssert([condition waitWithTimeout:testing::kWaitForJSCompletionTimeout], | 63 GREYAssert([condition waitWithTimeout:testing::kWaitForJSCompletionTimeout], |
| 64 @"Script execution timed out"); | 64 @"Script execution timed out"); |
| 65 | 65 |
| 66 if (out_error) | 66 if (out_error) |
| 67 [*out_error autorelease]; | 67 [*out_error autorelease]; |
| 68 return [result autorelease]; | 68 return [result autorelease]; |
| 69 } | 69 } |
| 70 | 70 |
| 71 } // namespace web | 71 } // namespace web |
| OLD | NEW |