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

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

Issue 1025613003: Fix for ERROR:url_pattern_set.cc(240)] Invalid url pattern: chrome://print/* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding test case. Created 5 years, 8 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
« no previous file with comments | « no previous file | extensions/browser/extension_prefs.h » ('j') | extensions/browser/extension_prefs.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_prefs_unittest.cc
diff --git a/chrome/browser/extensions/extension_prefs_unittest.cc b/chrome/browser/extensions/extension_prefs_unittest.cc
index d9067d3c9daaea0510bb1f46e465f4a605a9b0aa..ed8c68d2885c55b17f325b2f5dd9294cce753be1 100644
--- a/chrome/browser/extensions/extension_prefs_unittest.cc
+++ b/chrome/browser/extensions/extension_prefs_unittest.cc
@@ -913,4 +913,46 @@ class ExtensionPrefsClearLastLaunched : public ExtensionPrefsTest {
};
TEST_F(ExtensionPrefsClearLastLaunched, ExtensionPrefsClearLastLaunched) {}
+class ExtensionPrefsChromePattern : public ExtensionPrefsTest {
+ public:
+ ~ExtensionPrefsChromePattern() override {}
+ void Initialize() override {
+ base::DictionaryValue dictionary;
+ dictionary.SetString(manifest_keys::kName, "test");
+ dictionary.SetString(manifest_keys::kVersion, "0.1");
+ webstore_extension_ = prefs_.AddExtensionWithManifestAndFlags(
+ dictionary, Manifest::COMPONENT, Extension::NO_FLAGS);
+
+ APIPermissionSet api_perms;
+ api_perms.insert(APIPermission::kTab);
+ api_perms.insert(APIPermission::kBookmark);
+ api_perms.insert(APIPermission::kHistory);
+
+ ManifestPermissionSet empty_manifest_permissions;
+
+ URLPatternSet ehosts, shosts;
+ AddPattern(&shosts, "chrome://print/*");
not at google - send to devlin 2015/04/09 14:56:07 Thanks for writing this test, getting there, but I
Deepak 2015/04/10 05:16:34 1) I have added a new function in test_extension_p
+
+ active_perms_ = new PermissionSet(api_perms, empty_manifest_permissions,
+ ehosts, shosts);
+ // Set the active permissions.
+ prefs()->SetActivePermissions(webstore_extension_->id(),
+ active_perms_.get());
not at google - send to devlin 2015/04/09 14:56:07 I don't know exactly why that GetInstalledExtensio
Deepak 2015/04/10 05:16:34 Done.
+ }
+
+ void Verify() override {
+ URLPatternSet scriptable_hosts;
+ std::string pref_key = "active_permissions.scriptable_host";
+ prefs()->SetAllowFileAccess(webstore_extension_->id(), true);
not at google - send to devlin 2015/04/09 14:56:07 Why is file access relevant?
Deepak 2015/04/10 05:16:34 Done.
+ EXPECT_TRUE(prefs()->ReadPrefAsURLPatternSet(
+ webstore_extension_->id(), pref_key, &scriptable_hosts, 15));
+ }
+
+ private:
+ scoped_refptr<PermissionSet> active_perms_;
+ scoped_refptr<Extension> webstore_extension_;
+};
+TEST_F(ExtensionPrefsChromePattern, ExtensionPrefsChromePattern) {
+}
+
} // namespace extensions
« no previous file with comments | « no previous file | extensions/browser/extension_prefs.h » ('j') | extensions/browser/extension_prefs.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698