OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/js_test_util.h" | 5 #import "ios/web/public/test/js_test_util.h" |
6 | 6 |
7 #import <UIKit/UIKit.h> | 7 #import <UIKit/UIKit.h> |
8 #import <WebKit/WebKit.h> | 8 #import <WebKit/WebKit.h> |
9 | 9 |
10 #import "base/logging.h" | 10 #import "base/logging.h" |
11 #import "base/mac/scoped_nsobject.h" | 11 #import "base/mac/scoped_nsobject.h" |
| 12 #import "base/test/ios/wait_util.h" |
12 #import "base/time/time.h" | 13 #import "base/time/time.h" |
13 #import "base/test/ios/wait_util.h" | |
14 #import "ios/web/public/web_state/js/crw_js_injection_manager.h" | 14 #import "ios/web/public/web_state/js/crw_js_injection_manager.h" |
15 #import "ios/web/public/web_state/js/crw_js_injection_receiver.h" | 15 #import "ios/web/public/web_state/js/crw_js_injection_receiver.h" |
16 | 16 |
17 using base::Time; | 17 using base::Time; |
18 using base::TimeDelta; | 18 using base::TimeDelta; |
19 | 19 |
20 namespace { | 20 namespace { |
21 // The amount of time (in secs) |evaluate:StringResultHandler:| is given time to | 21 // The amount of time (in secs) |evaluate:StringResultHandler:| is given time to |
22 // process until the test fails. | 22 // process until the test fails. |
23 const NSTimeInterval kTimeout = 5.0; | 23 const NSTimeInterval kTimeout = 5.0; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 result.reset([evaluationResult copy]); | 66 result.reset([evaluationResult copy]); |
67 }]; | 67 }]; |
68 base::test::ios::WaitUntilCondition(^bool() { | 68 base::test::ios::WaitUntilCondition(^bool() { |
69 return result; | 69 return result; |
70 }); | 70 }); |
71 return [[result retain] autorelease]; | 71 return [[result retain] autorelease]; |
72 } | 72 } |
73 | 73 |
74 } // namespace web | 74 } // namespace web |
75 | 75 |
OLD | NEW |