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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 extensions::PermissionsRequestFunction::SetAutoConfirmForTests(true); | 406 extensions::PermissionsRequestFunction::SetAutoConfirmForTests(true); |
407 ASSERT_TRUE(StartEmbeddedTestServer()); | 407 ASSERT_TRUE(StartEmbeddedTestServer()); |
408 ASSERT_TRUE(RunExtensionTest("content_scripts/permissions")) << message_; | 408 ASSERT_TRUE(RunExtensionTest("content_scripts/permissions")) << message_; |
409 } | 409 } |
410 | 410 |
411 IN_PROC_BROWSER_TEST_F(ExtensionApiTestWithManagementPolicy, | 411 IN_PROC_BROWSER_TEST_F(ExtensionApiTestWithManagementPolicy, |
412 ContentScriptPolicy) { | 412 ContentScriptPolicy) { |
413 // Set enterprise policy to block injection to policy specified host. | 413 // Set enterprise policy to block injection to policy specified host. |
414 { | 414 { |
415 ExtensionManagementPolicyUpdater pref(&policy_provider_); | 415 ExtensionManagementPolicyUpdater pref(&policy_provider_); |
416 pref.AddRuntimeBlockedHost("*", "*://example.com/*"); | 416 pref.AddRuntimeBlockedHost("*", "*://example.com"); |
417 } | 417 } |
418 ASSERT_TRUE(StartEmbeddedTestServer()); | 418 ASSERT_TRUE(StartEmbeddedTestServer()); |
419 ASSERT_TRUE(RunExtensionTest("content_scripts/policy")) << message_; | 419 ASSERT_TRUE(RunExtensionTest("content_scripts/policy")) << message_; |
420 } | 420 } |
421 | 421 |
422 IN_PROC_BROWSER_TEST_P(ContentScriptApiTest, ContentScriptBypassPageCSP) { | 422 IN_PROC_BROWSER_TEST_P(ContentScriptApiTest, ContentScriptBypassPageCSP) { |
423 ASSERT_TRUE(StartEmbeddedTestServer()); | 423 ASSERT_TRUE(StartEmbeddedTestServer()); |
424 ASSERT_TRUE(RunExtensionTest("content_scripts/bypass_page_csp")) << message_; | 424 ASSERT_TRUE(RunExtensionTest("content_scripts/bypass_page_csp")) << message_; |
425 } | 425 } |
426 | 426 |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 EXPECT_FALSE(content_script_listener.was_satisfied()); | 610 EXPECT_FALSE(content_script_listener.was_satisfied()); |
611 } | 611 } |
612 | 612 |
613 INSTANTIATE_TEST_CASE_P( | 613 INSTANTIATE_TEST_CASE_P( |
614 ContentScriptApiTests, | 614 ContentScriptApiTests, |
615 ContentScriptApiTest, | 615 ContentScriptApiTest, |
616 testing::Values(TestConfig::kDefault, | 616 testing::Values(TestConfig::kDefault, |
617 TestConfig::kYieldBetweenContentScriptRunsEnabled)); | 617 TestConfig::kYieldBetweenContentScriptRunsEnabled)); |
618 | 618 |
619 } // namespace extensions | 619 } // namespace extensions |
OLD | NEW |