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

Side by Side Diff: chrome/browser/browsing_data/browsing_data_helper_unittest.cc

Issue 254763005: Move some content url constants to /url. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve a merge conflict. Created 6 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
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 "chrome/browser/browsing_data/browsing_data_helper.h" 5 #include "chrome/browser/browsing_data/browsing_data_helper.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "chrome/browser/extensions/mock_extension_special_storage_policy.h" 8 #include "chrome/browser/extensions/mock_extension_special_storage_policy.h"
9 #include "chrome/common/url_constants.h" 9 #include "chrome/common/url_constants.h"
10 #include "content/public/common/url_constants.h" 10 #include "content/public/common/url_constants.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 int mask, 51 int mask,
52 ExtensionSpecialStoragePolicy* policy) { 52 ExtensionSpecialStoragePolicy* policy) {
53 return BrowsingDataHelper::DoesOriginMatchMask(origin, mask, policy); 53 return BrowsingDataHelper::DoesOriginMatchMask(origin, mask, policy);
54 } 54 }
55 55
56 private: 56 private:
57 DISALLOW_COPY_AND_ASSIGN(BrowsingDataHelperTest); 57 DISALLOW_COPY_AND_ASSIGN(BrowsingDataHelperTest);
58 }; 58 };
59 59
60 TEST_F(BrowsingDataHelperTest, WebSafeSchemesAreWebSafe) { 60 TEST_F(BrowsingDataHelperTest, WebSafeSchemesAreWebSafe) {
61 EXPECT_TRUE(IsWebScheme(content::kHttpScheme)); 61 EXPECT_TRUE(IsWebScheme(url::kHttpScheme));
62 EXPECT_TRUE(IsWebScheme(content::kHttpsScheme)); 62 EXPECT_TRUE(IsWebScheme(url::kHttpsScheme));
63 EXPECT_TRUE(IsWebScheme(content::kFtpScheme)); 63 EXPECT_TRUE(IsWebScheme(content::kFtpScheme));
64 EXPECT_TRUE(IsWebScheme(content::kDataScheme)); 64 EXPECT_TRUE(IsWebScheme(content::kDataScheme));
65 EXPECT_TRUE(IsWebScheme("feed")); 65 EXPECT_TRUE(IsWebScheme("feed"));
66 EXPECT_TRUE(IsWebScheme(content::kBlobScheme)); 66 EXPECT_TRUE(IsWebScheme(content::kBlobScheme));
67 EXPECT_TRUE(IsWebScheme(content::kFileSystemScheme)); 67 EXPECT_TRUE(IsWebScheme(content::kFileSystemScheme));
68 EXPECT_FALSE(IsWebScheme("invalid-scheme-i-just-made-up")); 68 EXPECT_FALSE(IsWebScheme("invalid-scheme-i-just-made-up"));
69 } 69 }
70 70
71 TEST_F(BrowsingDataHelperTest, ChromeSchemesAreNotWebSafe) { 71 TEST_F(BrowsingDataHelperTest, ChromeSchemesAreNotWebSafe) {
72 EXPECT_FALSE(IsWebScheme(extensions::kExtensionScheme)); 72 EXPECT_FALSE(IsWebScheme(extensions::kExtensionScheme));
73 EXPECT_FALSE(IsWebScheme(content::kAboutScheme)); 73 EXPECT_FALSE(IsWebScheme(content::kAboutScheme));
74 EXPECT_FALSE(IsWebScheme(content::kChromeDevToolsScheme)); 74 EXPECT_FALSE(IsWebScheme(content::kChromeDevToolsScheme));
75 EXPECT_FALSE(IsWebScheme(content::kChromeUIScheme)); 75 EXPECT_FALSE(IsWebScheme(content::kChromeUIScheme));
76 EXPECT_FALSE(IsWebScheme(content::kJavaScriptScheme)); 76 EXPECT_FALSE(IsWebScheme(content::kJavaScriptScheme));
77 EXPECT_FALSE(IsWebScheme(content::kMailToScheme)); 77 EXPECT_FALSE(IsWebScheme(content::kMailToScheme));
78 EXPECT_FALSE(IsWebScheme(content::kMetadataScheme)); 78 EXPECT_FALSE(IsWebScheme(content::kMetadataScheme));
79 EXPECT_FALSE(IsWebScheme(content::kSwappedOutScheme)); 79 EXPECT_FALSE(IsWebScheme(content::kSwappedOutScheme));
80 EXPECT_FALSE(IsWebScheme(content::kViewSourceScheme)); 80 EXPECT_FALSE(IsWebScheme(content::kViewSourceScheme));
81 } 81 }
82 82
83 TEST_F(BrowsingDataHelperTest, WebSafeSchemesAreNotExtensions) { 83 TEST_F(BrowsingDataHelperTest, WebSafeSchemesAreNotExtensions) {
84 EXPECT_FALSE(IsExtensionScheme(content::kHttpScheme)); 84 EXPECT_FALSE(IsExtensionScheme(url::kHttpScheme));
85 EXPECT_FALSE(IsExtensionScheme(content::kHttpsScheme)); 85 EXPECT_FALSE(IsExtensionScheme(url::kHttpsScheme));
86 EXPECT_FALSE(IsExtensionScheme(content::kFtpScheme)); 86 EXPECT_FALSE(IsExtensionScheme(content::kFtpScheme));
87 EXPECT_FALSE(IsExtensionScheme(content::kDataScheme)); 87 EXPECT_FALSE(IsExtensionScheme(content::kDataScheme));
88 EXPECT_FALSE(IsExtensionScheme("feed")); 88 EXPECT_FALSE(IsExtensionScheme("feed"));
89 EXPECT_FALSE(IsExtensionScheme(content::kBlobScheme)); 89 EXPECT_FALSE(IsExtensionScheme(content::kBlobScheme));
90 EXPECT_FALSE(IsExtensionScheme(content::kFileSystemScheme)); 90 EXPECT_FALSE(IsExtensionScheme(content::kFileSystemScheme));
91 EXPECT_FALSE(IsExtensionScheme("invalid-scheme-i-just-made-up")); 91 EXPECT_FALSE(IsExtensionScheme("invalid-scheme-i-just-made-up"));
92 } 92 }
93 93
94 TEST_F(BrowsingDataHelperTest, ChromeSchemesAreNotAllExtension) { 94 TEST_F(BrowsingDataHelperTest, ChromeSchemesAreNotAllExtension) {
95 EXPECT_TRUE(IsExtensionScheme(extensions::kExtensionScheme)); 95 EXPECT_TRUE(IsExtensionScheme(extensions::kExtensionScheme));
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 EXPECT_TRUE(Match( 148 EXPECT_TRUE(Match(
149 kOrigin2, kUnprotected | kProtected | kExtension, mock_policy.get())); 149 kOrigin2, kUnprotected | kProtected | kExtension, mock_policy.get()));
150 EXPECT_TRUE(Match( 150 EXPECT_TRUE(Match(
151 kOriginExt, kUnprotected | kProtected | kExtension, mock_policy.get())); 151 kOriginExt, kUnprotected | kProtected | kExtension, mock_policy.get()));
152 EXPECT_FALSE(Match(kOriginDevTools, 152 EXPECT_FALSE(Match(kOriginDevTools,
153 kUnprotected | kProtected | kExtension, 153 kUnprotected | kProtected | kExtension,
154 mock_policy.get())); 154 mock_policy.get()));
155 } 155 }
156 156
157 } // namespace 157 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/zero_suggest_provider.cc ('k') | chrome/browser/browsing_data/cookies_tree_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698