| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 <UIKit/UIKit.h> | 5 #import <UIKit/UIKit.h> |
| 6 | 6 |
| 7 #include "base/mac/foundation_util.h" | 7 #include "base/mac/foundation_util.h" |
| 8 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #import "ios/chrome/browser/find_in_page/find_in_page_model.h" | 10 #import "ios/chrome/browser/find_in_page/find_in_page_model.h" |
| 11 #import "ios/chrome/browser/find_in_page/js_findinpage_manager.h" | 11 #import "ios/chrome/browser/find_in_page/js_findinpage_manager.h" |
| 12 #import "ios/chrome/browser/web/chrome_web_test.h" | 12 #import "ios/chrome/browser/web/chrome_web_test.h" |
| 13 #import "ios/web/public/web_state/crw_web_view_proxy.h" | |
| 14 #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 #import "ios/web/public/web_state/ui/crw_web_view_proxy.h" |
| 15 #import "ios/web/public/web_state/web_state.h" | 15 #import "ios/web/public/web_state/web_state.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 #include "testing/gtest_mac.h" | 17 #include "testing/gtest_mac.h" |
| 18 | 18 |
| 19 // Unit tests for the find_in_page.js JavaScript file. | 19 // Unit tests for the find_in_page.js JavaScript file. |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 // JavaScript invocation to search for 'foo' (for 1000 milliseconds). | 23 // JavaScript invocation to search for 'foo' (for 1000 milliseconds). |
| 24 NSString* kJavaScriptToSearchForFoo = | 24 NSString* kJavaScriptToSearchForFoo = |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 // point to the first visible occurence of the non-Ascii. | 217 // point to the first visible occurence of the non-Ascii. |
| 218 NSString* result = ExecuteJavaScript([NSString | 218 NSString* result = ExecuteJavaScript([NSString |
| 219 stringWithFormat:@"__gCrWeb.findInPage.highlightWord('%@', false, 1000)", | 219 stringWithFormat:@"__gCrWeb.findInPage.highlightWord('%@', false, 1000)", |
| 220 kNonAscii]); | 220 kNonAscii]); |
| 221 DCHECK(result); | 221 DCHECK(result); |
| 222 AssertJavaScriptValue(kJavaScriptIndex, 0); | 222 AssertJavaScriptValue(kJavaScriptIndex, 0); |
| 223 AssertJavaScriptValue(kJavaScriptSpansLength, 1); | 223 AssertJavaScriptValue(kJavaScriptSpansLength, 1); |
| 224 } | 224 } |
| 225 | 225 |
| 226 } // namespace | 226 } // namespace |
| OLD | NEW |