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

Side by Side Diff: content/browser/child_process_security_policy_unittest.cc

Issue 2403713002: Add suborigin logic to url::Origin (Closed)
Patch Set: Fix unit test Created 4 years, 1 month 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 <set> 5 #include <set>
6 #include <string> 6 #include <string>
7 7
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "content/browser/child_process_security_policy_impl.h" 9 #include "content/browser/child_process_security_policy_impl.h"
10 #include "content/public/common/url_constants.h" 10 #include "content/public/common/url_constants.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 EXPECT_FALSE(p->IsWebSafeScheme(kChromeUIScheme)); 134 EXPECT_FALSE(p->IsWebSafeScheme(kChromeUIScheme));
135 } 135 }
136 136
137 TEST_F(ChildProcessSecurityPolicyTest, IsPseudoSchemeTest) { 137 TEST_F(ChildProcessSecurityPolicyTest, IsPseudoSchemeTest) {
138 ChildProcessSecurityPolicyImpl* p = 138 ChildProcessSecurityPolicyImpl* p =
139 ChildProcessSecurityPolicyImpl::GetInstance(); 139 ChildProcessSecurityPolicyImpl::GetInstance();
140 140
141 EXPECT_TRUE(p->IsPseudoScheme(url::kAboutScheme)); 141 EXPECT_TRUE(p->IsPseudoScheme(url::kAboutScheme));
142 EXPECT_TRUE(p->IsPseudoScheme(url::kJavaScriptScheme)); 142 EXPECT_TRUE(p->IsPseudoScheme(url::kJavaScriptScheme));
143 EXPECT_TRUE(p->IsPseudoScheme(kViewSourceScheme)); 143 EXPECT_TRUE(p->IsPseudoScheme(kViewSourceScheme));
144 EXPECT_TRUE(p->IsPseudoScheme(kHttpSuboriginScheme)); 144 EXPECT_TRUE(p->IsPseudoScheme(url::kHttpSuboriginScheme));
145 EXPECT_TRUE(p->IsPseudoScheme(kHttpsSuboriginScheme)); 145 EXPECT_TRUE(p->IsPseudoScheme(url::kHttpsSuboriginScheme));
146 146
147 EXPECT_FALSE(p->IsPseudoScheme("registered-pseudo-scheme")); 147 EXPECT_FALSE(p->IsPseudoScheme("registered-pseudo-scheme"));
148 p->RegisterPseudoScheme("registered-pseudo-scheme"); 148 p->RegisterPseudoScheme("registered-pseudo-scheme");
149 EXPECT_TRUE(p->IsPseudoScheme("registered-pseudo-scheme")); 149 EXPECT_TRUE(p->IsPseudoScheme("registered-pseudo-scheme"));
150 150
151 EXPECT_FALSE(p->IsPseudoScheme(kChromeUIScheme)); 151 EXPECT_FALSE(p->IsPseudoScheme(kChromeUIScheme));
152 } 152 }
153 153
154 TEST_F(ChildProcessSecurityPolicyTest, StandardSchemesTest) { 154 TEST_F(ChildProcessSecurityPolicyTest, StandardSchemesTest) {
155 ChildProcessSecurityPolicyImpl* p = 155 ChildProcessSecurityPolicyImpl* p =
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 EXPECT_TRUE(p->CanCommitURL(kRendererID, url_foo2)); 880 EXPECT_TRUE(p->CanCommitURL(kRendererID, url_foo2));
881 EXPECT_TRUE(p->CanCommitURL(kRendererID, url_bar)); 881 EXPECT_TRUE(p->CanCommitURL(kRendererID, url_bar));
882 EXPECT_TRUE(p->CanSetAsOriginHeader(kRendererID, url_foo1)); 882 EXPECT_TRUE(p->CanSetAsOriginHeader(kRendererID, url_foo1));
883 EXPECT_TRUE(p->CanSetAsOriginHeader(kRendererID, url_foo2)); 883 EXPECT_TRUE(p->CanSetAsOriginHeader(kRendererID, url_foo2));
884 EXPECT_TRUE(p->CanSetAsOriginHeader(kRendererID, url_bar)); 884 EXPECT_TRUE(p->CanSetAsOriginHeader(kRendererID, url_bar));
885 885
886 p->Remove(kRendererID); 886 p->Remove(kRendererID);
887 } 887 }
888 888
889 } // namespace content 889 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/child_process_security_policy_impl.cc ('k') | content/browser/dom_storage/dom_storage_context_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698