Chromium Code Reviews| Index: content/browser/renderer_host/render_view_host_unittest.cc |
| diff --git a/content/browser/renderer_host/render_view_host_unittest.cc b/content/browser/renderer_host/render_view_host_unittest.cc |
| index f523c064edd676ed53164bed804d74a691125df4..0eb899b2b66c8dad221346186ddc3bcf851ecf2c 100644 |
| --- a/content/browser/renderer_host/render_view_host_unittest.cc |
| +++ b/content/browser/renderer_host/render_view_host_unittest.cc |
| @@ -2,6 +2,7 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| +#include "base/files/file_path.h" |
| #include "base/utf_string_conversions.h" |
| #include "content/browser/child_process_security_policy_impl.h" |
| #include "content/browser/renderer_host/test_render_view_host.h" |
| @@ -227,4 +228,22 @@ TEST_F(RenderViewHostTest, BadMessageHandlerInputEventAck) { |
| #endif |
| +TEST_F(RenderViewHostTest, MessageWithBadHistoryItemFiles) { |
| + int id = process()->GetID(); |
| + std::string file_name = "/tmp/foo"; |
|
darin (slow to review)
2013/05/06 23:39:47
I don't think this is going to work very well on W
|
| + EXPECT_EQ(0, process()->bad_msg_count()); |
| + test_rvh()->TestOnUpdateStateWithFile(id, file_name); |
| + EXPECT_EQ(1, process()->bad_msg_count()); |
| + |
| + ChildProcessSecurityPolicyImpl* policy = |
| + ChildProcessSecurityPolicyImpl::GetInstance(); |
| + policy->GrantPermissionsForFile(id, base::FilePath::FromUTF8Unsafe(file_name), |
| + base::PLATFORM_FILE_OPEN | |
| + base::PLATFORM_FILE_READ | |
| + base::PLATFORM_FILE_EXCLUSIVE_READ | |
| + base::PLATFORM_FILE_ASYNC); |
| + test_rvh()->TestOnUpdateStateWithFile(id, file_name); |
| + EXPECT_EQ(1, process()->bad_msg_count()); |
| +} |
| + |
| } // namespace content |