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/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 #define TEST_PATH(x) FILE_PATH_LITERAL("c:") FILE_PATH_LITERAL(x) | 24 #define TEST_PATH(x) FILE_PATH_LITERAL("c:") FILE_PATH_LITERAL(x) |
25 #else | 25 #else |
26 #define TEST_PATH(x) FILE_PATH_LITERAL(x) | 26 #define TEST_PATH(x) FILE_PATH_LITERAL(x) |
27 #endif | 27 #endif |
28 | 28 |
29 class ChildProcessSecurityPolicyTestBrowserClient | 29 class ChildProcessSecurityPolicyTestBrowserClient |
30 : public TestContentBrowserClient { | 30 : public TestContentBrowserClient { |
31 public: | 31 public: |
32 ChildProcessSecurityPolicyTestBrowserClient() {} | 32 ChildProcessSecurityPolicyTestBrowserClient() {} |
33 | 33 |
34 virtual bool IsHandledURL(const GURL& url) { | 34 virtual bool IsHandledURL(const GURL& url) OVERRIDE { |
35 return schemes_.find(url.scheme()) != schemes_.end(); | 35 return schemes_.find(url.scheme()) != schemes_.end(); |
36 } | 36 } |
37 | 37 |
38 void ClearSchemes() { | 38 void ClearSchemes() { |
39 schemes_.clear(); | 39 schemes_.clear(); |
40 } | 40 } |
41 | 41 |
42 void AddScheme(const std::string& scheme) { | 42 void AddScheme(const std::string& scheme) { |
43 schemes_.insert(scheme); | 43 schemes_.insert(scheme); |
44 } | 44 } |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 // queried on the IO thread. The ChildProcessSecurityPolicy needs to be | 542 // queried on the IO thread. The ChildProcessSecurityPolicy needs to be |
543 // prepared to answer policy questions about renderers who no longer exist. | 543 // prepared to answer policy questions about renderers who no longer exist. |
544 | 544 |
545 // In this case, we default to secure behavior. | 545 // In this case, we default to secure behavior. |
546 EXPECT_FALSE(p->CanRequestURL(kRendererID, url)); | 546 EXPECT_FALSE(p->CanRequestURL(kRendererID, url)); |
547 EXPECT_FALSE(p->CanReadFile(kRendererID, file)); | 547 EXPECT_FALSE(p->CanReadFile(kRendererID, file)); |
548 EXPECT_FALSE(p->HasWebUIBindings(kRendererID)); | 548 EXPECT_FALSE(p->HasWebUIBindings(kRendererID)); |
549 } | 549 } |
550 | 550 |
551 } // namespace content | 551 } // namespace content |
OLD | NEW |