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

Side by Side Diff: chrome/browser/extensions/api/content_settings/content_settings_unittest.cc

Issue 440423003: Clean content_settings_pattern_parser.* from unnecessary dependencies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix CrOS tests Created 6 years, 4 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/macros.h"
6 #include "chrome/browser/extensions/api/content_settings/content_settings_helper s.h"
7 #include "chrome/common/content_settings_component.h"
5 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
6 9
7 #include "chrome/browser/extensions/api/content_settings/content_settings_helper s.h"
8
9 namespace extensions { 10 namespace extensions {
10 namespace helpers = content_settings_helpers; 11 namespace helpers = content_settings_helpers;
11 12
12 TEST(ExtensionContentSettingsHelpersTest, ParseExtensionPattern) { 13 TEST(ExtensionContentSettingsHelpersTest, ParseExtensionPattern) {
14 InitContentSettingsComponent();
13 const struct { 15 const struct {
14 const char* extension_pattern; 16 const char* extension_pattern;
15 const char* content_settings_pattern; 17 const char* content_settings_pattern;
16 } kTestPatterns[] = { 18 } kTestPatterns[] = {
17 { "<all_urls>", "*" }, 19 { "<all_urls>", "*" },
18 { "*://*.google.com/*", "[*.]google.com" }, 20 { "*://*.google.com/*", "[*.]google.com" },
19 { "http://www.example.com/*", "http://www.example.com" }, 21 { "http://www.example.com/*", "http://www.example.com" },
20 { "*://www.example.com/*", "www.example.com" }, 22 { "*://www.example.com/*", "www.example.com" },
21 { "http://www.example.com:8080/*", "http://www.example.com:8080" }, 23 { "http://www.example.com:8080/*", "http://www.example.com:8080" },
22 { "https://*/*", "https://*" }, 24 { "https://*/*", "https://*" },
(...skipping 21 matching lines...) Expand all
44 ContentSettingsPattern pattern = helpers::ParseExtensionPattern( 46 ContentSettingsPattern pattern = helpers::ParseExtensionPattern(
45 kInvalidTestPatterns[i].extension_pattern, &error); 47 kInvalidTestPatterns[i].extension_pattern, &error);
46 EXPECT_FALSE(pattern.IsValid()); 48 EXPECT_FALSE(pattern.IsValid());
47 EXPECT_EQ(kInvalidTestPatterns[i].expected_error, error) 49 EXPECT_EQ(kInvalidTestPatterns[i].expected_error, error)
48 << "Unexpected error parsing " 50 << "Unexpected error parsing "
49 << kInvalidTestPatterns[i].extension_pattern; 51 << kInvalidTestPatterns[i].extension_pattern;
50 } 52 }
51 } 53 }
52 54
53 } // namespace extensions 55 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698