| Index: chrome/common/extensions/api/content_scripts/content_scripts_manifest_unittest.cc
|
| diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_contentscript_unittest.cc b/chrome/common/extensions/api/content_scripts/content_scripts_manifest_unittest.cc
|
| similarity index 54%
|
| rename from chrome/common/extensions/manifest_tests/extension_manifests_contentscript_unittest.cc
|
| rename to chrome/common/extensions/api/content_scripts/content_scripts_manifest_unittest.cc
|
| index 672c650b91eaaf28161f20731463db0a3115e8be..8ae652386dd35768667d7b466ce0493ef67d9927 100644
|
| --- a/chrome/common/extensions/manifest_tests/extension_manifests_contentscript_unittest.cc
|
| +++ b/chrome/common/extensions/api/content_scripts/content_scripts_manifest_unittest.cc
|
| @@ -1,22 +1,35 @@
|
| -// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved.
|
| // 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/string_number_conversions.h"
|
| +#include "chrome/common/extensions/api/content_scripts/content_scripts_handler.h"
|
| #include "chrome/common/extensions/extension.h"
|
| #include "chrome/common/extensions/extension_manifest_constants.h"
|
| +#include "chrome/common/extensions/manifest_handler.h"
|
| #include "extensions/common/error_utils.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| namespace errors = extension_manifest_errors;
|
|
|
| -TEST_F(ExtensionManifestTest, ContentScriptMatchPattern) {
|
| +namespace extensions {
|
| +
|
| +class ContentScriptsManifestTest : public ExtensionManifestTest {
|
| + protected:
|
| + virtual void SetUp() OVERRIDE {
|
| + ExtensionManifestTest::SetUp();
|
| + ManifestHandler::Register(extension_manifest_keys::kContentScripts,
|
| + new ContentScriptsHandler);
|
| + }
|
| +};
|
| +
|
| +TEST_F(ContentScriptsManifestTest, ContentScriptMatchPattern) {
|
| Testcase testcases[] = {
|
| // chrome:// urls are not allowed.
|
| Testcase("content_script_chrome_url_invalid.json",
|
| - extensions::ErrorUtils::FormatErrorMessage(
|
| + ErrorUtils::FormatErrorMessage(
|
| errors::kInvalidMatch,
|
| base::IntToString(0),
|
| base::IntToString(0),
|
| @@ -25,13 +38,15 @@ TEST_F(ExtensionManifestTest, ContentScriptMatchPattern) {
|
|
|
| // Match paterns must be strings.
|
| Testcase("content_script_match_pattern_not_string.json",
|
| - extensions::ErrorUtils::FormatErrorMessage(errors::kInvalidMatch,
|
| - base::IntToString(0),
|
| - base::IntToString(0),
|
| - errors::kExpectString))
|
| + ErrorUtils::FormatErrorMessage(errors::kInvalidMatch,
|
| + base::IntToString(0),
|
| + base::IntToString(0),
|
| + errors::kExpectString))
|
| };
|
| RunTestcases(testcases, arraysize(testcases),
|
| EXPECT_TYPE_ERROR);
|
|
|
| LoadAndExpectSuccess("ports_in_content_scripts.json");
|
| }
|
| +
|
| +} // namespace extensions
|
|
|