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

Unified Diff: chrome/browser/extensions/extension_management_unittest.cc

Issue 2499493004: Communicate ExtensionSettings policy to renderers (Closed)
Patch Set: Fix effective TLD wildcard bug, move to Leaky LazyInstance in PermissionsData, removed unnecessary … Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_management_unittest.cc
diff --git a/chrome/browser/extensions/extension_management_unittest.cc b/chrome/browser/extensions/extension_management_unittest.cc
index 176e7ca8eb47203ce4b8d25b2dc94a09f856eebf..47c38c3abd327a5a414efbc80b59cb8a97cfa83d 100644
--- a/chrome/browser/extensions/extension_management_unittest.cc
+++ b/chrome/browser/extensions/extension_management_unittest.cc
@@ -125,10 +125,6 @@ class ExtensionManagementServiceTest : public testing::Test {
return extension_management_->global_settings_.get();
}
- const URLPatternSet& GetRuntimeBlockedHostsById(const std::string& id) {
- return GetRuntimeBlockedHosts(id, kNonExistingUpdateUrl);
- }
-
ExtensionManagement::InstallationMode GetInstallationModeById(
const std::string& id) {
return GetInstallationMode(id, kNonExistingUpdateUrl);
@@ -179,13 +175,11 @@ class ExtensionManagementServiceTest : public testing::Test {
return extension_management_->GetInstallationMode(extension.get());
}
- // Wrapper of ExtensionManagement::GetRuntimeBlockedHosts, |id| and
- // |update_url| are used to construct an Extension for testing.
- URLPatternSet GetRuntimeBlockedHosts(
- const std::string& id,
- const std::string& update_url) {
+ // Wrapper of ExtensionManagement::GetRuntimeBlockedHosts, |id| is used
+ // to construct an Extension for testing.
+ URLPatternSet GetRuntimeBlockedHosts(const std::string& id) {
scoped_refptr<const Extension> extension =
- CreateExtension(Manifest::UNPACKED, "0.1", id, update_url);
+ CreateExtension(Manifest::UNPACKED, "0.1", id, kNonExistingUpdateUrl);
return extension_management_->GetRuntimeBlockedHosts(extension.get());
}
@@ -441,10 +435,10 @@ TEST_F(ExtensionManagementServiceTest, PreferenceParsing) {
ExtensionManagement::INSTALLATION_BLOCKED);
EXPECT_EQ(GetInstallationModeByUpdateUrl(kExampleUpdateUrl),
ExtensionManagement::INSTALLATION_ALLOWED);
- EXPECT_TRUE(GetRuntimeBlockedHostsById(kTargetExtension).empty());
- EXPECT_TRUE(GetRuntimeBlockedHostsById(kTargetExtension4)
+ EXPECT_TRUE(GetRuntimeBlockedHosts(kTargetExtension).is_empty());
+ EXPECT_TRUE(GetRuntimeBlockedHosts(kTargetExtension4)
.MatchesURL(GURL("http://test.foo.com/test")));
- EXPECT_TRUE(GetRuntimeBlockedHostsById(kTargetExtension4)
+ EXPECT_TRUE(GetRuntimeBlockedHosts(kTargetExtension4)
.MatchesURL(GURL("https://bar.org/test")));
// Verifies global settings.
@@ -453,7 +447,7 @@ TEST_F(ExtensionManagementServiceTest, PreferenceParsing) {
EXPECT_EQ(allowed_sites.size(), 1u);
EXPECT_TRUE(allowed_sites.MatchesURL(GURL("http://foo.com/entry")));
EXPECT_FALSE(allowed_sites.MatchesURL(GURL("http://bar.com/entry")));
- EXPECT_TRUE(GetRuntimeBlockedHostsById(kNonExistingExtension)
+ EXPECT_TRUE(GetRuntimeBlockedHosts(kNonExistingExtension)
.MatchesURL(GURL("http://example.com/default")));
EXPECT_TRUE(ReadGlobalSettings()->has_restricted_allowed_types);

Powered by Google App Engine
This is Rietveld 408576698