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

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

Issue 23658056: content: Move kHttpScheme constant into content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 "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(chrome::kHttpScheme)); 61 EXPECT_TRUE(IsWebScheme(content::kHttpScheme));
62 EXPECT_TRUE(IsWebScheme(content::kHttpsScheme)); 62 EXPECT_TRUE(IsWebScheme(content::kHttpsScheme));
63 EXPECT_TRUE(IsWebScheme(chrome::kFtpScheme)); 63 EXPECT_TRUE(IsWebScheme(chrome::kFtpScheme));
64 EXPECT_TRUE(IsWebScheme(chrome::kDataScheme)); 64 EXPECT_TRUE(IsWebScheme(chrome::kDataScheme));
65 EXPECT_TRUE(IsWebScheme("feed")); 65 EXPECT_TRUE(IsWebScheme("feed"));
66 EXPECT_TRUE(IsWebScheme(chrome::kBlobScheme)); 66 EXPECT_TRUE(IsWebScheme(chrome::kBlobScheme));
67 EXPECT_TRUE(IsWebScheme(chrome::kFileSystemScheme)); 67 EXPECT_TRUE(IsWebScheme(chrome::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(chrome::kAboutScheme)); 73 EXPECT_FALSE(IsWebScheme(chrome::kAboutScheme));
74 EXPECT_FALSE(IsWebScheme(chrome::kChromeDevToolsScheme)); 74 EXPECT_FALSE(IsWebScheme(chrome::kChromeDevToolsScheme));
75 EXPECT_FALSE(IsWebScheme(chrome::kChromeInternalScheme)); 75 EXPECT_FALSE(IsWebScheme(chrome::kChromeInternalScheme));
76 EXPECT_FALSE(IsWebScheme(chrome::kChromeUIScheme)); 76 EXPECT_FALSE(IsWebScheme(chrome::kChromeUIScheme));
77 EXPECT_FALSE(IsWebScheme(content::kJavaScriptScheme)); 77 EXPECT_FALSE(IsWebScheme(content::kJavaScriptScheme));
78 EXPECT_FALSE(IsWebScheme(content::kMailToScheme)); 78 EXPECT_FALSE(IsWebScheme(content::kMailToScheme));
79 EXPECT_FALSE(IsWebScheme(content::kMetadataScheme)); 79 EXPECT_FALSE(IsWebScheme(content::kMetadataScheme));
80 EXPECT_FALSE(IsWebScheme(content::kSwappedOutScheme)); 80 EXPECT_FALSE(IsWebScheme(content::kSwappedOutScheme));
81 EXPECT_FALSE(IsWebScheme(content::kViewSourceScheme)); 81 EXPECT_FALSE(IsWebScheme(content::kViewSourceScheme));
82 } 82 }
83 83
84 TEST_F(BrowsingDataHelperTest, WebSafeSchemesAreNotExtensions) { 84 TEST_F(BrowsingDataHelperTest, WebSafeSchemesAreNotExtensions) {
85 EXPECT_FALSE(IsExtensionScheme(chrome::kHttpScheme)); 85 EXPECT_FALSE(IsExtensionScheme(content::kHttpScheme));
86 EXPECT_FALSE(IsExtensionScheme(content::kHttpsScheme)); 86 EXPECT_FALSE(IsExtensionScheme(content::kHttpsScheme));
87 EXPECT_FALSE(IsExtensionScheme(chrome::kFtpScheme)); 87 EXPECT_FALSE(IsExtensionScheme(chrome::kFtpScheme));
88 EXPECT_FALSE(IsExtensionScheme(chrome::kDataScheme)); 88 EXPECT_FALSE(IsExtensionScheme(chrome::kDataScheme));
89 EXPECT_FALSE(IsExtensionScheme("feed")); 89 EXPECT_FALSE(IsExtensionScheme("feed"));
90 EXPECT_FALSE(IsExtensionScheme(chrome::kBlobScheme)); 90 EXPECT_FALSE(IsExtensionScheme(chrome::kBlobScheme));
91 EXPECT_FALSE(IsExtensionScheme(chrome::kFileSystemScheme)); 91 EXPECT_FALSE(IsExtensionScheme(chrome::kFileSystemScheme));
92 EXPECT_FALSE(IsExtensionScheme("invalid-scheme-i-just-made-up")); 92 EXPECT_FALSE(IsExtensionScheme("invalid-scheme-i-just-made-up"));
93 } 93 }
94 94
95 TEST_F(BrowsingDataHelperTest, ChromeSchemesAreNotAllExtension) { 95 TEST_F(BrowsingDataHelperTest, ChromeSchemesAreNotAllExtension) {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 EXPECT_TRUE(Match( 150 EXPECT_TRUE(Match(
151 kOrigin2, kUnprotected | kProtected | kExtension, mock_policy.get())); 151 kOrigin2, kUnprotected | kProtected | kExtension, mock_policy.get()));
152 EXPECT_TRUE(Match( 152 EXPECT_TRUE(Match(
153 kOriginExt, kUnprotected | kProtected | kExtension, mock_policy.get())); 153 kOriginExt, kUnprotected | kProtected | kExtension, mock_policy.get()));
154 EXPECT_FALSE(Match(kOriginDevTools, 154 EXPECT_FALSE(Match(kOriginDevTools,
155 kUnprotected | kProtected | kExtension, 155 kUnprotected | kProtected | kExtension,
156 mock_policy.get())); 156 mock_policy.get()));
157 } 157 }
158 158
159 } // namespace 159 } // 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