| 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 <WebKit/WebKit.h> | 7 #import <WebKit/WebKit.h> |
| 8 | 8 |
| 9 #import "base/logging.h" | 9 #include "base/logging.h" |
| 10 #import "base/mac/scoped_nsobject.h" | 10 #import "base/mac/scoped_nsobject.h" |
| 11 #import "base/test/ios/wait_util.h" | 11 #import "base/test/ios/wait_util.h" |
| 12 #import "ios/web/public/web_state/js/crw_js_injection_manager.h" | 12 #import "ios/web/public/web_state/js/crw_js_injection_manager.h" |
| 13 #import "ios/web/public/web_state/js/crw_js_injection_receiver.h" | 13 #import "ios/web/public/web_state/js/crw_js_injection_receiver.h" |
| 14 | 14 |
| 15 namespace web { | 15 namespace web { |
| 16 | 16 |
| 17 id ExecuteJavaScript(CRWJSInjectionManager* manager, NSString* script) { | 17 id ExecuteJavaScript(CRWJSInjectionManager* manager, NSString* script) { |
| 18 __block base::scoped_nsobject<NSString> result; | 18 __block base::scoped_nsobject<NSString> result; |
| 19 __block bool completed = false; | 19 __block bool completed = false; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 completed = true; | 51 completed = true; |
| 52 }]; | 52 }]; |
| 53 base::test::ios::WaitUntilCondition(^{ | 53 base::test::ios::WaitUntilCondition(^{ |
| 54 return completed; | 54 return completed; |
| 55 }); | 55 }); |
| 56 return [[result retain] autorelease]; | 56 return [[result retain] autorelease]; |
| 57 } | 57 } |
| 58 | 58 |
| 59 } // namespace web | 59 } // namespace web |
| 60 | 60 |
| OLD | NEW |