| 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 #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 // Testing class of JsInjectioManager that has no dependencies. | 19 // Testing class of JsInjectioManager that has no dependencies. |
| 16 @interface TestingCRWJSBaseManager : CRWJSInjectionManager | 20 @interface TestingCRWJSBaseManager : CRWJSInjectionManager |
| 17 @end | 21 @end |
| 18 | 22 |
| 19 @implementation TestingCRWJSBaseManager | 23 @implementation TestingCRWJSBaseManager |
| 20 | 24 |
| 21 - (NSString*)staticInjectionContent { | 25 - (NSString*)staticInjectionContent { |
| 22 return @"base = {};"; | 26 return @"base = {};"; |
| 23 } | 27 } |
| 24 | 28 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 EXPECT_NSNE([manager injectionContent], [manager injectionContent]); | 171 EXPECT_NSNE([manager injectionContent], [manager injectionContent]); |
| 168 } | 172 } |
| 169 | 173 |
| 170 // Tests that checking for an uninjected presence beacon returns false. | 174 // Tests that checking for an uninjected presence beacon returns false. |
| 171 TEST_F(JsInjectionManagerTest, WebControllerCheckForUninjectedScript) { | 175 TEST_F(JsInjectionManagerTest, WebControllerCheckForUninjectedScript) { |
| 172 EXPECT_FALSE([web_state()->GetJSInjectionReceiver() | 176 EXPECT_FALSE([web_state()->GetJSInjectionReceiver() |
| 173 scriptHasBeenInjectedForClass:Nil]); | 177 scriptHasBeenInjectedForClass:Nil]); |
| 174 } | 178 } |
| 175 | 179 |
| 176 } // namespace web | 180 } // namespace web |
| OLD | NEW |