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

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

Issue 2332263002: Updated suborigin serialization to latest spec proposal (Closed)
Patch Set: Created 4 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
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 ChildProcessSecurityPolicyTestBrowserClient test_browser_client_; 113 ChildProcessSecurityPolicyTestBrowserClient test_browser_client_;
114 ContentBrowserClient* old_browser_client_; 114 ContentBrowserClient* old_browser_client_;
115 }; 115 };
116 116
117 117
118 TEST_F(ChildProcessSecurityPolicyTest, IsWebSafeSchemeTest) { 118 TEST_F(ChildProcessSecurityPolicyTest, IsWebSafeSchemeTest) {
119 ChildProcessSecurityPolicyImpl* p = 119 ChildProcessSecurityPolicyImpl* p =
120 ChildProcessSecurityPolicyImpl::GetInstance(); 120 ChildProcessSecurityPolicyImpl::GetInstance();
121 121
122 EXPECT_TRUE(p->IsWebSafeScheme(url::kHttpScheme)); 122 EXPECT_TRUE(p->IsWebSafeScheme(url::kHttpScheme));
123 EXPECT_TRUE(p->IsWebSafeScheme(url::kHttpSecureScheme));
Mike West 2016/09/13 18:00:18 s/SecureScheme/SuboriginScheme/?
jww 2016/09/13 18:36:04 Yikes. I thought I complied this test, but I guess
123 EXPECT_TRUE(p->IsWebSafeScheme(url::kHttpsScheme)); 124 EXPECT_TRUE(p->IsWebSafeScheme(url::kHttpsScheme));
125 EXPECT_TRUE(p->IsWebSafeScheme(url::kHttpsSecureScheme));
Mike West 2016/09/13 18:00:18 Ditto.
jww 2016/09/13 18:36:04 Done.
124 EXPECT_TRUE(p->IsWebSafeScheme(url::kFtpScheme)); 126 EXPECT_TRUE(p->IsWebSafeScheme(url::kFtpScheme));
125 EXPECT_TRUE(p->IsWebSafeScheme(url::kDataScheme)); 127 EXPECT_TRUE(p->IsWebSafeScheme(url::kDataScheme));
126 EXPECT_TRUE(p->IsWebSafeScheme("feed")); 128 EXPECT_TRUE(p->IsWebSafeScheme("feed"));
127 EXPECT_TRUE(p->IsWebSafeScheme(url::kBlobScheme)); 129 EXPECT_TRUE(p->IsWebSafeScheme(url::kBlobScheme));
128 EXPECT_TRUE(p->IsWebSafeScheme(url::kFileSystemScheme)); 130 EXPECT_TRUE(p->IsWebSafeScheme(url::kFileSystemScheme));
129 131
130 EXPECT_FALSE(p->IsWebSafeScheme("registered-web-safe-scheme")); 132 EXPECT_FALSE(p->IsWebSafeScheme("registered-web-safe-scheme"));
131 p->RegisterWebSafeScheme("registered-web-safe-scheme"); 133 p->RegisterWebSafeScheme("registered-web-safe-scheme");
132 EXPECT_TRUE(p->IsWebSafeScheme("registered-web-safe-scheme")); 134 EXPECT_TRUE(p->IsWebSafeScheme("registered-web-safe-scheme"));
133 135
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 EXPECT_TRUE(p->CanRequestURL(kRendererID, url_foo2)); 729 EXPECT_TRUE(p->CanRequestURL(kRendererID, url_foo2));
728 EXPECT_TRUE(p->CanRequestURL(kRendererID, url_bar)); 730 EXPECT_TRUE(p->CanRequestURL(kRendererID, url_bar));
729 EXPECT_TRUE(p->CanCommitURL(kRendererID, url_foo1)); 731 EXPECT_TRUE(p->CanCommitURL(kRendererID, url_foo1));
730 EXPECT_TRUE(p->CanCommitURL(kRendererID, url_foo2)); 732 EXPECT_TRUE(p->CanCommitURL(kRendererID, url_foo2));
731 EXPECT_TRUE(p->CanCommitURL(kRendererID, url_bar)); 733 EXPECT_TRUE(p->CanCommitURL(kRendererID, url_bar));
732 734
733 p->Remove(kRendererID); 735 p->Remove(kRendererID);
734 } 736 }
735 737
736 } // namespace content 738 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698