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 23283007: Move kJavaScriptScheme into content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: content:: is necessary in web_drag_source_mac.mm Created 7 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 <set> 5 #include <set>
6 #include <string> 6 #include <string>
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/platform_file.h" 10 #include "base/platform_file.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 EXPECT_TRUE(p->IsWebSafeScheme("registered-web-safe-scheme")); 112 EXPECT_TRUE(p->IsWebSafeScheme("registered-web-safe-scheme"));
113 113
114 EXPECT_FALSE(p->IsWebSafeScheme(chrome::kChromeUIScheme)); 114 EXPECT_FALSE(p->IsWebSafeScheme(chrome::kChromeUIScheme));
115 } 115 }
116 116
117 TEST_F(ChildProcessSecurityPolicyTest, IsPseudoSchemeTest) { 117 TEST_F(ChildProcessSecurityPolicyTest, IsPseudoSchemeTest) {
118 ChildProcessSecurityPolicyImpl* p = 118 ChildProcessSecurityPolicyImpl* p =
119 ChildProcessSecurityPolicyImpl::GetInstance(); 119 ChildProcessSecurityPolicyImpl::GetInstance();
120 120
121 EXPECT_TRUE(p->IsPseudoScheme(chrome::kAboutScheme)); 121 EXPECT_TRUE(p->IsPseudoScheme(chrome::kAboutScheme));
122 EXPECT_TRUE(p->IsPseudoScheme(chrome::kJavaScriptScheme)); 122 EXPECT_TRUE(p->IsPseudoScheme(kJavaScriptScheme));
123 EXPECT_TRUE(p->IsPseudoScheme(kViewSourceScheme)); 123 EXPECT_TRUE(p->IsPseudoScheme(kViewSourceScheme));
124 124
125 EXPECT_FALSE(p->IsPseudoScheme("registered-pseudo-scheme")); 125 EXPECT_FALSE(p->IsPseudoScheme("registered-pseudo-scheme"));
126 p->RegisterPseudoScheme("registered-pseudo-scheme"); 126 p->RegisterPseudoScheme("registered-pseudo-scheme");
127 EXPECT_TRUE(p->IsPseudoScheme("registered-pseudo-scheme")); 127 EXPECT_TRUE(p->IsPseudoScheme("registered-pseudo-scheme"));
128 128
129 EXPECT_FALSE(p->IsPseudoScheme(chrome::kChromeUIScheme)); 129 EXPECT_FALSE(p->IsPseudoScheme(chrome::kChromeUIScheme));
130 } 130 }
131 131
132 TEST_F(ChildProcessSecurityPolicyTest, StandardSchemesTest) { 132 TEST_F(ChildProcessSecurityPolicyTest, StandardSchemesTest) {
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 // queried on the IO thread. The ChildProcessSecurityPolicy needs to be 708 // queried on the IO thread. The ChildProcessSecurityPolicy needs to be
709 // prepared to answer policy questions about renderers who no longer exist. 709 // prepared to answer policy questions about renderers who no longer exist.
710 710
711 // In this case, we default to secure behavior. 711 // In this case, we default to secure behavior.
712 EXPECT_FALSE(p->CanRequestURL(kRendererID, url)); 712 EXPECT_FALSE(p->CanRequestURL(kRendererID, url));
713 EXPECT_FALSE(p->CanReadFile(kRendererID, file)); 713 EXPECT_FALSE(p->CanReadFile(kRendererID, file));
714 EXPECT_FALSE(p->HasWebUIBindings(kRendererID)); 714 EXPECT_FALSE(p->HasWebUIBindings(kRendererID));
715 } 715 }
716 716
717 } // namespace content 717 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/child_process_security_policy_impl.cc ('k') | content/browser/renderer_host/render_view_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698