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/chrome/browser/find_in_page/js_findinpage_manager.h" |
| 6 |
5 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
6 | 8 |
7 #import "base/test/ios/wait_util.h" | 9 #import "base/test/ios/wait_util.h" |
8 #import "ios/chrome/browser/find_in_page/js_findinpage_manager.h" | |
9 #import "ios/chrome/browser/web/chrome_web_test.h" | 10 #import "ios/chrome/browser/web/chrome_web_test.h" |
10 #import "ios/web/public/web_state/js/crw_js_injection_receiver.h" | 11 #import "ios/web/public/web_state/js/crw_js_injection_receiver.h" |
11 #import "ios/web/public/web_state/web_state.h" | 12 #import "ios/web/public/web_state/web_state.h" |
12 #import "testing/gtest_mac.h" | 13 #import "testing/gtest_mac.h" |
13 | 14 |
14 // Test fixture to test Find In Page JS. | 15 // Test fixture to test Find In Page JS. |
15 class JsFindinpageManagerTest : public ChromeWebTest { | 16 class JsFindinpageManagerTest : public ChromeWebTest { |
16 protected: | 17 protected: |
17 // Loads the given HTML and initializes the findInPage JS scripts. | 18 // Loads the given HTML and initializes the findInPage JS scripts. |
18 void LoadHtml(NSString* html) { | 19 void LoadHtml(NSString* html) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 EXPECT_NSNE(@YES, result); | 71 EXPECT_NSNE(@YES, result); |
71 completion_handler_block_was_called = YES; | 72 completion_handler_block_was_called = YES; |
72 }]; | 73 }]; |
73 }; | 74 }; |
74 [manager_ findString:@"');token=true;('" | 75 [manager_ findString:@"');token=true;('" |
75 completionHandler:completion_handler_block]; | 76 completionHandler:completion_handler_block]; |
76 base::test::ios::WaitUntilCondition(^bool() { | 77 base::test::ios::WaitUntilCondition(^bool() { |
77 return completion_handler_block_was_called; | 78 return completion_handler_block_was_called; |
78 }); | 79 }); |
79 } | 80 } |
OLD | NEW |