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

Unified Diff: chrome/common/extensions/manifest_tests/extension_manifests_contentscript_unittest.cc

Issue 12792005: Allow extensions on chrome:// URLs, when flag is set and permission is explicitly requested (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reinstate original pickle order; add scripts clause to content_script_chrome_url_invalid.json to av… Created 7 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/common/extensions/manifest_tests/extension_manifests_contentscript_unittest.cc
diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_contentscript_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_contentscript_unittest.cc
index 3eb72aa525d52be1688386a29ab86a78c24f707c..84708932a569bab4bef17330e7861ac9da68ddad 100644
--- a/chrome/common/extensions/manifest_tests/extension_manifests_contentscript_unittest.cc
+++ b/chrome/common/extensions/manifest_tests/extension_manifests_contentscript_unittest.cc
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/common/extensions/manifest_tests/extension_manifest_test.h"
-
+#include "base/command_line.h"
#include "base/strings/string_number_conversions.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_manifest_constants.h"
+#include "chrome/common/extensions/manifest_tests/extension_manifest_test.h"
#include "extensions/common/error_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -35,3 +36,14 @@ TEST_F(ExtensionManifestTest, ContentScriptMatchPattern) {
LoadAndExpectSuccess("ports_in_content_scripts.json");
}
+
+TEST_F(ExtensionManifestTest, ContentScriptsOnChromeUrlsWithFlag) {
+ CommandLine::ForCurrentProcess()->AppendSwitch(
+ switches::kExtensionsOnChromeURLs);
+ std::string error;
+ scoped_refptr<extensions::Extension> extension =
+ LoadAndExpectSuccess("content_script_chrome_url_invalid.json");
+ EXPECT_EQ("", error);
+ const GURL newtab_url("chrome://newtab/");
+ EXPECT_TRUE(extension->HasContentScriptAtURL(newtab_url));
+}

Powered by Google App Engine
This is Rietveld 408576698