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

Side by Side Diff: chrome/browser/extensions/content_script_apitest.cc

Issue 2957233002: Fix parsing of effective TLD wildcarding across IPC. (Closed)
Patch Set: Created 3 years, 5 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 (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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_F(ExtensionApiTestWithManagementPolicy,
423 ContentScriptPolicyWildcard) {
424 // Set enterprise policy to block injection to policy specified hosts.
425 // Verifies wildcard can be used for effecitve TLD.
lazyboy 2017/06/30 20:43:22 Move this line as a test description before line 4
nrpeter 2017/06/30 21:22:15 Done.
426 {
427 ExtensionManagementPolicyUpdater pref(&policy_provider_);
428 pref.AddRuntimeBlockedHost("*", "*://example.*");
429 }
430 ASSERT_TRUE(StartEmbeddedTestServer());
431 ASSERT_TRUE(RunExtensionTest("content_scripts/policy")) << message_;
432 }
433
422 IN_PROC_BROWSER_TEST_P(ContentScriptApiTest, ContentScriptBypassPageCSP) { 434 IN_PROC_BROWSER_TEST_P(ContentScriptApiTest, ContentScriptBypassPageCSP) {
423 ASSERT_TRUE(StartEmbeddedTestServer()); 435 ASSERT_TRUE(StartEmbeddedTestServer());
424 ASSERT_TRUE(RunExtensionTest("content_scripts/bypass_page_csp")) << message_; 436 ASSERT_TRUE(RunExtensionTest("content_scripts/bypass_page_csp")) << message_;
425 } 437 }
426 438
427 // Test that when injecting a blocking content script, other scripts don't run 439 // Test that when injecting a blocking content script, other scripts don't run
428 // until the blocking script finishes. 440 // until the blocking script finishes.
429 IN_PROC_BROWSER_TEST_P(ContentScriptApiTest, ContentScriptBlockingScript) { 441 IN_PROC_BROWSER_TEST_P(ContentScriptApiTest, ContentScriptBlockingScript) {
430 ASSERT_TRUE(StartEmbeddedTestServer()); 442 ASSERT_TRUE(StartEmbeddedTestServer());
431 443
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 EXPECT_FALSE(content_script_listener.was_satisfied()); 622 EXPECT_FALSE(content_script_listener.was_satisfied());
611 } 623 }
612 624
613 INSTANTIATE_TEST_CASE_P( 625 INSTANTIATE_TEST_CASE_P(
614 ContentScriptApiTests, 626 ContentScriptApiTests,
615 ContentScriptApiTest, 627 ContentScriptApiTest,
616 testing::Values(TestConfig::kDefault, 628 testing::Values(TestConfig::kDefault,
617 TestConfig::kYieldBetweenContentScriptRunsEnabled)); 629 TestConfig::kYieldBetweenContentScriptRunsEnabled));
618 630
619 } // namespace extensions 631 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | extensions/common/extension_messages.cc » ('j') | extensions/common/extension_messages.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698