OLD | NEW |
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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 101 |
102 EXPECT_FALSE(p->IsWebSafeScheme(chrome::kChromeUIScheme)); | 102 EXPECT_FALSE(p->IsWebSafeScheme(chrome::kChromeUIScheme)); |
103 } | 103 } |
104 | 104 |
105 TEST_F(ChildProcessSecurityPolicyTest, IsPseudoSchemeTest) { | 105 TEST_F(ChildProcessSecurityPolicyTest, IsPseudoSchemeTest) { |
106 ChildProcessSecurityPolicyImpl* p = | 106 ChildProcessSecurityPolicyImpl* p = |
107 ChildProcessSecurityPolicyImpl::GetInstance(); | 107 ChildProcessSecurityPolicyImpl::GetInstance(); |
108 | 108 |
109 EXPECT_TRUE(p->IsPseudoScheme(chrome::kAboutScheme)); | 109 EXPECT_TRUE(p->IsPseudoScheme(chrome::kAboutScheme)); |
110 EXPECT_TRUE(p->IsPseudoScheme(chrome::kJavaScriptScheme)); | 110 EXPECT_TRUE(p->IsPseudoScheme(chrome::kJavaScriptScheme)); |
111 EXPECT_TRUE(p->IsPseudoScheme(chrome::kViewSourceScheme)); | 111 EXPECT_TRUE(p->IsPseudoScheme(kViewSourceScheme)); |
112 | 112 |
113 EXPECT_FALSE(p->IsPseudoScheme("registered-pseudo-scheme")); | 113 EXPECT_FALSE(p->IsPseudoScheme("registered-pseudo-scheme")); |
114 p->RegisterPseudoScheme("registered-pseudo-scheme"); | 114 p->RegisterPseudoScheme("registered-pseudo-scheme"); |
115 EXPECT_TRUE(p->IsPseudoScheme("registered-pseudo-scheme")); | 115 EXPECT_TRUE(p->IsPseudoScheme("registered-pseudo-scheme")); |
116 | 116 |
117 EXPECT_FALSE(p->IsPseudoScheme(chrome::kChromeUIScheme)); | 117 EXPECT_FALSE(p->IsPseudoScheme(chrome::kChromeUIScheme)); |
118 } | 118 } |
119 | 119 |
120 TEST_F(ChildProcessSecurityPolicyTest, IsDisabledSchemeTest) { | 120 TEST_F(ChildProcessSecurityPolicyTest, IsDisabledSchemeTest) { |
121 ChildProcessSecurityPolicyImpl* p = | 121 ChildProcessSecurityPolicyImpl* p = |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 // queried on the IO thread. The ChildProcessSecurityPolicy needs to be | 549 // queried on the IO thread. The ChildProcessSecurityPolicy needs to be |
550 // prepared to answer policy questions about renderers who no longer exist. | 550 // prepared to answer policy questions about renderers who no longer exist. |
551 | 551 |
552 // In this case, we default to secure behavior. | 552 // In this case, we default to secure behavior. |
553 EXPECT_FALSE(p->CanRequestURL(kRendererID, url)); | 553 EXPECT_FALSE(p->CanRequestURL(kRendererID, url)); |
554 EXPECT_FALSE(p->CanReadFile(kRendererID, file)); | 554 EXPECT_FALSE(p->CanReadFile(kRendererID, file)); |
555 EXPECT_FALSE(p->HasWebUIBindings(kRendererID)); | 555 EXPECT_FALSE(p->HasWebUIBindings(kRendererID)); |
556 } | 556 } |
557 | 557 |
558 } // namespace content | 558 } // namespace content |
OLD | NEW |