| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/logging.h" | 6 #include "base/logging.h" |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 | 294 |
| 295 GURL accessible_resource_with_csp(embedded_test_server()->GetURL( | 295 GURL accessible_resource_with_csp(embedded_test_server()->GetURL( |
| 296 "/extensions/api_test/extension_resource_request_policy/" | 296 "/extensions/api_test/extension_resource_request_policy/" |
| 297 "web_accessible/accessible_resource_with_csp.html")); | 297 "web_accessible/accessible_resource_with_csp.html")); |
| 298 ui_test_utils::NavigateToURL(browser(), accessible_resource_with_csp); | 298 ui_test_utils::NavigateToURL(browser(), accessible_resource_with_csp); |
| 299 ASSERT_TRUE(content::ExecuteScriptAndExtractString( | 299 ASSERT_TRUE(content::ExecuteScriptAndExtractString( |
| 300 browser()->tab_strip_model()->GetActiveWebContents(), | 300 browser()->tab_strip_model()->GetActiveWebContents(), |
| 301 "window.domAutomationController.send(document.title)", | 301 "window.domAutomationController.send(document.title)", |
| 302 &result)); | 302 &result)); |
| 303 EXPECT_EQ("Loaded", result); | 303 EXPECT_EQ("Loaded", result); |
| 304 // The violation is not intentional. See crbug.com/616181 |
| 305 SetExpectCSPErrorMessages(true); |
| 304 } | 306 } |
| 305 | 307 |
| 306 IN_PROC_BROWSER_TEST_F(ExtensionResourceRequestPolicyTest, Iframe) { | 308 IN_PROC_BROWSER_TEST_F(ExtensionResourceRequestPolicyTest, Iframe) { |
| 307 // Load another extension, which the test one shouldn't be able to get | 309 // Load another extension, which the test one shouldn't be able to get |
| 308 // resources from. | 310 // resources from. |
| 309 ASSERT_TRUE(LoadExtension(test_data_dir_ | 311 ASSERT_TRUE(LoadExtension(test_data_dir_ |
| 310 .AppendASCII("extension_resource_request_policy") | 312 .AppendASCII("extension_resource_request_policy") |
| 311 .AppendASCII("inaccessible"))); | 313 .AppendASCII("inaccessible"))); |
| 312 EXPECT_TRUE(RunExtensionSubtest( | 314 EXPECT_TRUE(RunExtensionSubtest( |
| 313 "extension_resource_request_policy/web_accessible", | 315 "extension_resource_request_policy/web_accessible", |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 | 374 |
| 373 content::WebContents* web_contents = | 375 content::WebContents* web_contents = |
| 374 browser()->tab_strip_model()->GetActiveWebContents(); | 376 browser()->tab_strip_model()->GetActiveWebContents(); |
| 375 | 377 |
| 376 GURL private_page( | 378 GURL private_page( |
| 377 "chrome-extension://kegmjfcnjamahdnldjmlpachmpielcdk/private.html"); | 379 "chrome-extension://kegmjfcnjamahdnldjmlpachmpielcdk/private.html"); |
| 378 NavigationErrorObserver observer(web_contents, private_page); | 380 NavigationErrorObserver observer(web_contents, private_page); |
| 379 ASSERT_TRUE(content::ExecuteScript(web_contents, "navigateFrameNow()")); | 381 ASSERT_TRUE(content::ExecuteScript(web_contents, "navigateFrameNow()")); |
| 380 observer.Wait(); | 382 observer.Wait(); |
| 381 } | 383 } |
| OLD | NEW |