Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: ios/chrome/browser/find_in_page/js_findinpage_manager_unittest.mm

Issue 2941053002: [ObjC ARC] Converts ios/chrome/browser/find_in_page:unit_tests_nonarc to ARC. (Closed)
Patch Set: Consolidated build.gn Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ios/chrome/browser/find_in_page/find_in_page_js_unittest.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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" 5 #import "ios/chrome/browser/find_in_page/js_findinpage_manager.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 8
9 #import "base/test/ios/wait_util.h" 9 #import "base/test/ios/wait_util.h"
10 #import "ios/chrome/browser/web/chrome_web_test.h" 10 #import "ios/chrome/browser/web/chrome_web_test.h"
11 #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"
12 #import "ios/web/public/web_state/web_state.h" 12 #import "ios/web/public/web_state/web_state.h"
13 #import "testing/gtest_mac.h" 13 #import "testing/gtest_mac.h"
14 14
15 #if !defined(__has_feature) || !__has_feature(objc_arc)
16 #error "This file requires ARC support."
17 #endif
18
15 // Test fixture to test Find In Page JS. 19 // Test fixture to test Find In Page JS.
16 class JsFindinpageManagerTest : public ChromeWebTest { 20 class JsFindinpageManagerTest : public ChromeWebTest {
17 protected: 21 protected:
18 // Loads the given HTML and initializes the findInPage JS scripts. 22 // Loads the given HTML and initializes the findInPage JS scripts.
19 void LoadHtml(NSString* html) { 23 void LoadHtml(NSString* html) {
20 ChromeWebTest::LoadHtml(html); 24 ChromeWebTest::LoadHtml(html);
21 manager_ = 25 manager_ =
22 static_cast<JsFindinpageManager*>([web_state()->GetJSInjectionReceiver() 26 static_cast<JsFindinpageManager*>([web_state()->GetJSInjectionReceiver()
23 instanceOfClass:[JsFindinpageManager class]]); 27 instanceOfClass:[JsFindinpageManager class]]);
24 [manager_ inject]; 28 [manager_ inject];
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 EXPECT_NSNE(@YES, result); 75 EXPECT_NSNE(@YES, result);
72 completion_handler_block_was_called = YES; 76 completion_handler_block_was_called = YES;
73 }]; 77 }];
74 }; 78 };
75 [manager_ findString:@"');token=true;('" 79 [manager_ findString:@"');token=true;('"
76 completionHandler:completion_handler_block]; 80 completionHandler:completion_handler_block];
77 base::test::ios::WaitUntilCondition(^bool() { 81 base::test::ios::WaitUntilCondition(^bool() {
78 return completion_handler_block_was_called; 82 return completion_handler_block_was_called;
79 }); 83 });
80 } 84 }
OLDNEW
« no previous file with comments | « ios/chrome/browser/find_in_page/find_in_page_js_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698