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

Side by Side Diff: ios/web/web_state/js/crw_js_early_script_manager_unittest.mm

Issue 1171203004: Correct iOS build for latest Xcode beta. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 5 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
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/web/web_state/js/crw_js_early_script_manager.h" 5 #import "ios/web/web_state/js/crw_js_early_script_manager.h"
6 6
7 #include "base/mac/scoped_nsobject.h" 7 #include "base/mac/scoped_nsobject.h"
8 #import "ios/web/public/test/crw_test_js_injection_receiver.h" 8 #import "ios/web/public/test/crw_test_js_injection_receiver.h"
9 #include "ios/web/public/web_client.h" 9 #include "ios/web/public/web_client.h"
10 #import "ios/web/web_state/js/page_script_util.h" 10 #import "ios/web/web_state/js/page_script_util.h"
(...skipping 25 matching lines...) Expand all
36 }; 36 };
37 37
38 // Tests that CRWJSEarlyScriptManager's content is the same as returned by 38 // Tests that CRWJSEarlyScriptManager's content is the same as returned by
39 // web::GetEarlyPageScript. 39 // web::GetEarlyPageScript.
40 TEST_F(CRWJSEarlyScriptManagerTest, Content) { 40 TEST_F(CRWJSEarlyScriptManagerTest, Content) {
41 NSString* injectionContent = [earlyScriptManager_ staticInjectionContent]; 41 NSString* injectionContent = [earlyScriptManager_ staticInjectionContent];
42 NSString* earlyScript = GetEarlyPageScript([receiver_ webViewType]); 42 NSString* earlyScript = GetEarlyPageScript([receiver_ webViewType]);
43 // |earlyScript| is a substring of |injectionContent|. The latter wraps the 43 // |earlyScript| is a substring of |injectionContent|. The latter wraps the
44 // former with "if (typeof __gCrWeb !== 'object')" check to avoid multiple 44 // former with "if (typeof __gCrWeb !== 'object')" check to avoid multiple
45 // injections. 45 // injections.
46 EXPECT_NE(NSNotFound, [injectionContent rangeOfString:earlyScript].location); 46 // TODO(justincohen): Cast indexOfObject to work around Xcode beta bugs.
47 // Revisit in future betas where hopefully these types match again.
48 // crbug.com/498825
49 EXPECT_NE(NSNotFound,
50 static_cast<NSInteger>(
51 [injectionContent rangeOfString:earlyScript].location));
47 } 52 }
48 53
49 } // namespace 54 } // namespace
50 } // namespace web 55 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/weak_nsobject_counter.mm ('k') | ios/web/web_state/ui/crw_ui_simple_web_view_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698