Index: chrome/common/extensions/manifest_tests/extension_manifests_chromepermission_unittest.cc |
diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_chromepermission_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_chromepermission_unittest.cc |
index a0b2c7013ce6bda193fbca90f0b25a7696495185..56e217cf3315c70e55f79d4891b9152a19b53531 100644 |
--- a/chrome/common/extensions/manifest_tests/extension_manifests_chromepermission_unittest.cc |
+++ b/chrome/common/extensions/manifest_tests/extension_manifests_chromepermission_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 "chrome/common/chrome_switches.h" |
#include "chrome/common/extensions/extension.h" |
#include "chrome/common/extensions/extension_manifest_constants.h" |
#include "chrome/common/extensions/manifest.h" |
+#include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" |
#include "testing/gtest/include/gtest/gtest.h" |
namespace errors = extension_manifest_errors; |
@@ -16,6 +17,21 @@ TEST_F(ExtensionManifestTest, ChromeURLPermissionInvalid) { |
errors::kInvalidPermissionScheme); |
} |
+TEST_F(ExtensionManifestTest, ChromeURLPermissionAllowedWithFlag) { |
+ CommandLine::ForCurrentProcess()->AppendSwitch( |
+ switches::kExtensionsOnChromeURLs); |
+ std::string error; |
+ scoped_refptr<extensions::Extension> extension = |
+ LoadAndExpectSuccess("permission_chrome_url_invalid.json"); |
+ EXPECT_EQ("", error); |
+ const GURL newtab_url("chrome://newtab/"); |
+ EXPECT_TRUE(extension->CanExecuteScriptOnPage(newtab_url, |
+ newtab_url, |
+ 0, |
+ NULL, |
+ &error)) << error; |
+} |
+ |
TEST_F(ExtensionManifestTest, ChromeResourcesPermissionValidOnlyForComponents) { |
LoadAndExpectError("permission_chrome_resources_url.json", |
errors::kInvalidPermissionScheme); |