OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/containers/hash_tables.h" | 6 #include "base/containers/hash_tables.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" | 8 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" |
9 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 9 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
10 #include "content/browser/frame_host/navigator.h" | 10 #include "content/browser/frame_host/navigator.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 123 |
124 // The goal of these tests will be to "simulate" exploited renderer processes, | 124 // The goal of these tests will be to "simulate" exploited renderer processes, |
125 // which can send arbitrary IPC messages and confuse browser process internal | 125 // which can send arbitrary IPC messages and confuse browser process internal |
126 // state, leading to security bugs. We are trying to verify that the browser | 126 // state, leading to security bugs. We are trying to verify that the browser |
127 // doesn't perform any dangerous operations in such cases. | 127 // doesn't perform any dangerous operations in such cases. |
128 class SecurityExploitBrowserTest : public ContentBrowserTest { | 128 class SecurityExploitBrowserTest : public ContentBrowserTest { |
129 public: | 129 public: |
130 SecurityExploitBrowserTest() {} | 130 SecurityExploitBrowserTest() {} |
131 | 131 |
132 void SetUpCommandLine(base::CommandLine* command_line) override { | 132 void SetUpCommandLine(base::CommandLine* command_line) override { |
133 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 133 ASSERT_TRUE(embedded_test_server()->Start()); |
134 | 134 |
135 // Add a host resolver rule to map all outgoing requests to the test server. | 135 // Add a host resolver rule to map all outgoing requests to the test server. |
136 // This allows us to use "real" hostnames in URLs, which we can use to | 136 // This allows us to use "real" hostnames in URLs, which we can use to |
137 // create arbitrary SiteInstances. | 137 // create arbitrary SiteInstances. |
138 command_line->AppendSwitchASCII( | 138 command_line->AppendSwitchASCII( |
139 switches::kHostResolverRules, | 139 switches::kHostResolverRules, |
140 "MAP * " + | 140 "MAP * " + |
141 net::HostPortPair::FromURL(embedded_test_server()->base_url()) | 141 net::HostPortPair::FromURL(embedded_test_server()->base_url()) |
142 .ToString() + | 142 .ToString() + |
143 ",EXCLUDE localhost"); | 143 ",EXCLUDE localhost"); |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); | 429 RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); |
430 IPC::IpcSecurityTestUtil::PwnMessageReceived( | 430 IPC::IpcSecurityTestUtil::PwnMessageReceived( |
431 web_rfh->GetProcess()->GetChannel(), | 431 web_rfh->GetProcess()->GetChannel(), |
432 ResourceHostMsg_RequestResource(web_rfh->GetRoutingID(), 1, | 432 ResourceHostMsg_RequestResource(web_rfh->GetRoutingID(), 1, |
433 invalid_scheme_origin_msg)); | 433 invalid_scheme_origin_msg)); |
434 web_process_killed.Wait(); | 434 web_process_killed.Wait(); |
435 } | 435 } |
436 } | 436 } |
437 | 437 |
438 } // namespace content | 438 } // namespace content |
OLD | NEW |