OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/web_state/js/crw_js_injection_manager.h" | 5 #import "ios/web/public/web_state/js/crw_js_injection_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 | 9 |
10 #import "ios/web/public/test/web_test_with_web_state.h" | 10 #import "ios/web/public/test/web_test_with_web_state.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 #include "testing/gtest_mac.h" | 13 #import "testing/gtest_mac.h" |
14 | 14 |
15 // Testing class of JsInjectioManager that has no dependencies. | 15 // Testing class of JsInjectioManager that has no dependencies. |
16 @interface TestingCRWJSBaseManager : CRWJSInjectionManager | 16 @interface TestingCRWJSBaseManager : CRWJSInjectionManager |
17 @end | 17 @end |
18 | 18 |
19 @implementation TestingCRWJSBaseManager | 19 @implementation TestingCRWJSBaseManager |
20 | 20 |
21 - (NSString*)staticInjectionContent { | 21 - (NSString*)staticInjectionContent { |
22 return @"base = {};"; | 22 return @"base = {};"; |
23 } | 23 } |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 EXPECT_NSNE([manager injectionContent], [manager injectionContent]); | 167 EXPECT_NSNE([manager injectionContent], [manager injectionContent]); |
168 } | 168 } |
169 | 169 |
170 // Tests that checking for an uninjected presence beacon returns false. | 170 // Tests that checking for an uninjected presence beacon returns false. |
171 TEST_F(JsInjectionManagerTest, WebControllerCheckForUninjectedScript) { | 171 TEST_F(JsInjectionManagerTest, WebControllerCheckForUninjectedScript) { |
172 EXPECT_FALSE([web_state()->GetJSInjectionReceiver() | 172 EXPECT_FALSE([web_state()->GetJSInjectionReceiver() |
173 scriptHasBeenInjectedForClass:Nil]); | 173 scriptHasBeenInjectedForClass:Nil]); |
174 } | 174 } |
175 | 175 |
176 } // namespace web | 176 } // namespace web |
OLD | NEW |