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

Side by Side Diff: chrome/common/extensions/manifest_handlers/content_scripts_manifest_unittest.cc

Issue 14694010: Consolidate manifest handler registration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/strings/string_number_conversions.h" 6 #include "base/strings/string_number_conversions.h"
7 #include "chrome/common/chrome_switches.h" 7 #include "chrome/common/chrome_switches.h"
8 #include "chrome/common/extensions/extension.h" 8 #include "chrome/common/extensions/extension.h"
9 #include "chrome/common/extensions/extension_manifest_constants.h" 9 #include "chrome/common/extensions/extension_manifest_constants.h"
10 #include "chrome/common/extensions/manifest_handlers/content_scripts_handler.h" 10 #include "chrome/common/extensions/manifest_handlers/content_scripts_handler.h"
11 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" 11 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h"
12 #include "extensions/common/error_utils.h" 12 #include "extensions/common/error_utils.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 14
15 namespace errors = extension_manifest_errors; 15 namespace errors = extension_manifest_errors;
16 16
17 namespace extensions { 17 namespace extensions {
18 18
19 class ContentScriptsManifestTest : public ExtensionManifestTest { 19 class ContentScriptsManifestTest : public ExtensionManifestTest {
20 protected:
21 virtual void SetUp() OVERRIDE {
22 ExtensionManifestTest::SetUp();
23 (new ContentScriptsHandler)->Register();
24 }
25 }; 20 };
26 21
27 TEST_F(ContentScriptsManifestTest, MatchPattern) { 22 TEST_F(ContentScriptsManifestTest, MatchPattern) {
28 Testcase testcases[] = { 23 Testcase testcases[] = {
29 // chrome:// urls are not allowed. 24 // chrome:// urls are not allowed.
30 Testcase("content_script_chrome_url_invalid.json", 25 Testcase("content_script_chrome_url_invalid.json",
31 ErrorUtils::FormatErrorMessage( 26 ErrorUtils::FormatErrorMessage(
32 errors::kInvalidMatch, 27 errors::kInvalidMatch,
33 base::IntToString(0), 28 base::IntToString(0),
34 base::IntToString(0), 29 base::IntToString(0),
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 ContentScriptsInfo::GetScriptableHosts(extension); 61 ContentScriptsInfo::GetScriptableHosts(extension);
67 62
68 URLPatternSet expected; 63 URLPatternSet expected;
69 expected.AddPattern( 64 expected.AddPattern(
70 URLPattern(URLPattern::SCHEME_HTTP, "http://yahoo.com/*")); 65 URLPattern(URLPattern::SCHEME_HTTP, "http://yahoo.com/*"));
71 66
72 EXPECT_EQ(expected, scriptable_hosts); 67 EXPECT_EQ(expected, scriptable_hosts);
73 } 68 }
74 69
75 } // namespace extensions 70 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698