OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/platform_file.h" | 9 #include "base/platform_file.h" |
10 #include "content/browser/child_process_security_policy.h" | 10 #include "content/browser/child_process_security_policy.h" |
11 #include "content/common/test_url_constants.h" | 11 #include "content/common/test_url_constants.h" |
12 #include "content/common/url_constants.h" | 12 #include "content/public/common/url_constants.h" |
13 #include "net/url_request/url_request.h" | 13 #include "net/url_request/url_request.h" |
14 #include "net/url_request/url_request_test_job.h" | 14 #include "net/url_request/url_request_test_job.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 | 16 |
17 class ChildProcessSecurityPolicyTest : public testing::Test { | 17 class ChildProcessSecurityPolicyTest : public testing::Test { |
18 protected: | 18 protected: |
19 // testing::Test | 19 // testing::Test |
20 virtual void SetUp() { | 20 virtual void SetUp() { |
21 // In the real world, "chrome:" is a handled scheme. | 21 // In the real world, "chrome:" is a handled scheme. |
22 RegisterProtocolFactory(chrome::kChromeUIScheme, | 22 RegisterProtocolFactory(chrome::kChromeUIScheme, |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 | 430 |
431 // Renderers are added and removed on the UI thread, but the policy can be | 431 // Renderers are added and removed on the UI thread, but the policy can be |
432 // queried on the IO thread. The ChildProcessSecurityPolicy needs to be | 432 // queried on the IO thread. The ChildProcessSecurityPolicy needs to be |
433 // prepared to answer policy questions about renderers who no longer exist. | 433 // prepared to answer policy questions about renderers who no longer exist. |
434 | 434 |
435 // In this case, we default to secure behavior. | 435 // In this case, we default to secure behavior. |
436 EXPECT_FALSE(p->CanRequestURL(kRendererID, url)); | 436 EXPECT_FALSE(p->CanRequestURL(kRendererID, url)); |
437 EXPECT_FALSE(p->CanReadFile(kRendererID, file)); | 437 EXPECT_FALSE(p->CanReadFile(kRendererID, file)); |
438 EXPECT_FALSE(p->HasWebUIBindings(kRendererID)); | 438 EXPECT_FALSE(p->HasWebUIBindings(kRendererID)); |
439 } | 439 } |
OLD | NEW |