blob: 1358af28fd98e39ce08854b993b5e1544661e6c9 [file] [log] [blame]
[email protected]81374f22013-02-07 02:03:451// 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
3// found in the LICENSE file.
4
5#include "base/command_line.h"
[email protected]04cbd3d2013-12-04 04:58:206#include "base/containers/hash_tables.h"
nick4c8dfd42014-11-14 04:11:497#include "base/strings/utf_string_conversions.h"
[email protected]04cbd3d2013-12-04 04:58:208#include "content/browser/dom_storage/dom_storage_context_wrapper.h"
9#include "content/browser/dom_storage/session_storage_namespace_impl.h"
[email protected]65920f332014-03-04 21:14:1810#include "content/browser/frame_host/navigator.h"
creis3710b2382015-08-18 00:12:1511#include "content/browser/frame_host/render_frame_host_impl.h"
[email protected]04cbd3d2013-12-04 04:58:2012#include "content/browser/renderer_host/render_view_host_factory.h"
[email protected]81374f22013-02-07 02:03:4513#include "content/browser/renderer_host/render_view_host_impl.h"
14#include "content/browser/web_contents/web_contents_impl.h"
nick4c8dfd42014-11-14 04:11:4915#include "content/common/frame_messages.h"
creis3710b2382015-08-18 00:12:1516#include "content/common/resource_messages.h"
[email protected]04cbd3d2013-12-04 04:58:2017#include "content/common/view_messages.h"
18#include "content/public/browser/browser_context.h"
creis3710b2382015-08-18 00:12:1519#include "content/public/browser/content_browser_client.h"
nick4c8dfd42014-11-14 04:11:4920#include "content/public/browser/interstitial_page.h"
21#include "content/public/browser/interstitial_page_delegate.h"
[email protected]04cbd3d2013-12-04 04:58:2022#include "content/public/browser/storage_partition.h"
creis3710b2382015-08-18 00:12:1523#include "content/public/common/appcache_info.h"
[email protected]81374f22013-02-07 02:03:4524#include "content/public/common/content_switches.h"
wfh815c4872015-02-25 21:01:3125#include "content/public/common/file_chooser_params.h"
[email protected]04cbd3d2013-12-04 04:58:2026#include "content/public/test/browser_test_utils.h"
[email protected]6e9def12014-03-27 20:23:2827#include "content/public/test/content_browser_test.h"
28#include "content/public/test/content_browser_test_utils.h"
[email protected]81374f22013-02-07 02:03:4529#include "content/public/test/test_utils.h"
[email protected]de7d61ff2013-08-20 11:30:4130#include "content/shell/browser/shell.h"
creis3710b2382015-08-18 00:12:1531#include "content/test/test_content_browser_client.h"
nick4c8dfd42014-11-14 04:11:4932#include "ipc/ipc_security_test_util.h"
33#include "net/dns/mock_host_resolver.h"
34#include "net/test/embedded_test_server/embedded_test_server.h"
35
36using IPC::IpcSecurityTestUtil;
[email protected]81374f22013-02-07 02:03:4537
38namespace content {
39
[email protected]04cbd3d2013-12-04 04:58:2040namespace {
41
42// This is a helper function for the tests which attempt to create a
43// duplicate RenderViewHost or RenderWidgetHost. It tries to create two objects
44// with the same process and routing ids, which causes a collision.
45// It creates a couple of windows in process 1, which causes a few routing ids
46// to be allocated. Then a cross-process navigation is initiated, which causes a
47// new process 2 to be created and have a pending RenderViewHost for it. The
48// routing id of the RenderViewHost which is target for a duplicate is set
49// into |target_routing_id| and the pending RenderViewHost which is used for
50// the attempt is the return value.
51RenderViewHostImpl* PrepareToDuplicateHosts(Shell* shell,
52 int* target_routing_id) {
nick4c8dfd42014-11-14 04:11:4953 GURL foo("http://foo.com/simple_page.html");
[email protected]04cbd3d2013-12-04 04:58:2054
55 // Start off with initial navigation, so we get the first process allocated.
56 NavigateToURL(shell, foo);
nick4c8dfd42014-11-14 04:11:4957 EXPECT_EQ(base::ASCIIToUTF16("OK"), shell->web_contents()->GetTitle());
[email protected]04cbd3d2013-12-04 04:58:2058
59 // Open another window, so we generate some more routing ids.
60 ShellAddedObserver shell2_observer;
61 EXPECT_TRUE(ExecuteScript(
62 shell->web_contents(), "window.open(document.URL + '#2');"));
63 Shell* shell2 = shell2_observer.GetShell();
64
65 // The new window must be in the same process, but have a new routing id.
66 EXPECT_EQ(shell->web_contents()->GetRenderViewHost()->GetProcess()->GetID(),
67 shell2->web_contents()->GetRenderViewHost()->GetProcess()->GetID());
68 *target_routing_id =
69 shell2->web_contents()->GetRenderViewHost()->GetRoutingID();
70 EXPECT_NE(*target_routing_id,
71 shell->web_contents()->GetRenderViewHost()->GetRoutingID());
72
73 // Now, simulate a link click coming from the renderer.
nick4c8dfd42014-11-14 04:11:4974 GURL extension_url("https://bar.com/simple_page.html");
[email protected]04cbd3d2013-12-04 04:58:2075 WebContentsImpl* wc = static_cast<WebContentsImpl*>(shell->web_contents());
[email protected]65920f332014-03-04 21:14:1876 wc->GetFrameTree()->root()->navigator()->RequestOpenURL(
lfg9ef7d2d2014-12-15 22:32:3077 wc->GetFrameTree()->root()->current_frame_host(), extension_url, nullptr,
nick94144d42015-04-27 19:21:4078 Referrer(), CURRENT_TAB, false, true);
[email protected]04cbd3d2013-12-04 04:58:2079
80 // Since the navigation above requires a cross-process swap, there will be a
carloskc49005eb2015-06-16 11:25:0781 // speculative/pending RenderFrameHost. Ensure it exists and is in a different
82 // process than the initial page.
83 RenderFrameHostImpl* next_rfh;
84 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
85 switches::kEnableBrowserSideNavigation)) {
86 next_rfh =
clamy11e11512015-07-07 16:42:1787 wc->GetRenderManagerForTesting()->speculative_frame_host();
carloskc49005eb2015-06-16 11:25:0788 } else {
89 next_rfh = wc->GetRenderManagerForTesting()->pending_frame_host();
90 }
[email protected]04cbd3d2013-12-04 04:58:2091
carloskc49005eb2015-06-16 11:25:0792 EXPECT_TRUE(next_rfh);
93 EXPECT_NE(shell->web_contents()->GetRenderProcessHost()->GetID(),
94 next_rfh->GetProcess()->GetID());
95
96 return next_rfh->render_view_host();
[email protected]04cbd3d2013-12-04 04:58:2097}
98
creis3710b2382015-08-18 00:12:1599ResourceHostMsg_Request CreateXHRRequestWithOrigin(const char* origin) {
100 ResourceHostMsg_Request request;
101 request.method = "GET";
102 request.url = GURL("http://bar.com/simple_page.html");
103 request.first_party_for_cookies = GURL(origin);
104 request.referrer_policy = blink::WebReferrerPolicyDefault;
105 request.headers = base::StringPrintf("Origin: %s\r\n", origin);
106 request.load_flags = 0;
107 request.origin_pid = 0;
108 request.resource_type = RESOURCE_TYPE_XHR;
109 request.request_context = 0;
110 request.appcache_host_id = kAppCacheNoHostId;
111 request.download_to_file = false;
112 request.should_reset_appcache = false;
113 request.is_main_frame = true;
114 request.parent_is_main_frame = false;
115 request.parent_render_frame_id = -1;
116 request.transition_type = ui::PAGE_TRANSITION_LINK;
117 request.allow_download = true;
118 return request;
119}
120
[email protected]04cbd3d2013-12-04 04:58:20121} // namespace
122
123
[email protected]81374f22013-02-07 02:03:45124// The goal of these tests will be to "simulate" exploited renderer processes,
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
127// doesn't perform any dangerous operations in such cases.
128class SecurityExploitBrowserTest : public ContentBrowserTest {
129 public:
130 SecurityExploitBrowserTest() {}
nick4c8dfd42014-11-14 04:11:49131
avi83883c82014-12-23 00:08:49132 void SetUpCommandLine(base::CommandLine* command_line) override {
nick4c8dfd42014-11-14 04:11:49133 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
[email protected]81374f22013-02-07 02:03:45134
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
137 // create arbitrary SiteInstances.
138 command_line->AppendSwitchASCII(
139 switches::kHostResolverRules,
nick4c8dfd42014-11-14 04:11:49140 "MAP * " +
141 net::HostPortPair::FromURL(embedded_test_server()->base_url())
142 .ToString() +
[email protected]81374f22013-02-07 02:03:45143 ",EXCLUDE localhost");
144 }
wfh815c4872015-02-25 21:01:31145
146 protected:
147 // Tests that a given file path sent in a ViewHostMsg_RunFileChooser will
148 // cause renderer to be killed.
149 void TestFileChooserWithPath(const base::FilePath& path);
[email protected]81374f22013-02-07 02:03:45150};
151
wfh815c4872015-02-25 21:01:31152void SecurityExploitBrowserTest::TestFileChooserWithPath(
153 const base::FilePath& path) {
154 GURL foo("http://foo.com/simple_page.html");
155 NavigateToURL(shell(), foo);
156 EXPECT_EQ(base::ASCIIToUTF16("OK"), shell()->web_contents()->GetTitle());
157
creis3710b2382015-08-18 00:12:15158 RenderViewHost* compromised_renderer =
wfh815c4872015-02-25 21:01:31159 shell()->web_contents()->GetRenderViewHost();
creis3710b2382015-08-18 00:12:15160 RenderProcessHostWatcher terminated(
wfh815c4872015-02-25 21:01:31161 shell()->web_contents(),
creis3710b2382015-08-18 00:12:15162 RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT);
wfh815c4872015-02-25 21:01:31163
164 FileChooserParams params;
165 params.default_file_name = path;
166
167 ViewHostMsg_RunFileChooser evil(compromised_renderer->GetRoutingID(), params);
168
169 IpcSecurityTestUtil::PwnMessageReceived(
170 compromised_renderer->GetProcess()->GetChannel(), evil);
171 terminated.Wait();
172}
173
[email protected]81374f22013-02-07 02:03:45174// Ensure that we kill the renderer process if we try to give it WebUI
175// properties and it doesn't have enabled WebUI bindings.
jaekyun37e572a32014-12-04 23:33:35176IN_PROC_BROWSER_TEST_F(SecurityExploitBrowserTest, SetWebUIProperty) {
nick4c8dfd42014-11-14 04:11:49177 GURL foo("http://foo.com/simple_page.html");
[email protected]81374f22013-02-07 02:03:45178
179 NavigateToURL(shell(), foo);
nick4c8dfd42014-11-14 04:11:49180 EXPECT_EQ(base::ASCIIToUTF16("OK"), shell()->web_contents()->GetTitle());
[email protected]81374f22013-02-07 02:03:45181 EXPECT_EQ(0,
182 shell()->web_contents()->GetRenderViewHost()->GetEnabledBindings());
183
creis3710b2382015-08-18 00:12:15184 RenderProcessHostWatcher terminated(
[email protected]8ffad4e2014-01-02 23:18:26185 shell()->web_contents(),
creis3710b2382015-08-18 00:12:15186 RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT);
[email protected]81374f22013-02-07 02:03:45187 shell()->web_contents()->GetRenderViewHost()->SetWebUIProperty(
188 "toolkit", "views");
189 terminated.Wait();
190}
191
[email protected]04cbd3d2013-12-04 04:58:20192// This is a test for crbug.com/312016 attempting to create duplicate
193// RenderViewHosts. SetupForDuplicateHosts sets up this test case and leaves
194// it in a state with pending RenderViewHost. Before the commit of the new
195// pending RenderViewHost, this test case creates a new window through the new
196// process.
197IN_PROC_BROWSER_TEST_F(SecurityExploitBrowserTest,
198 AttemptDuplicateRenderViewHost) {
dcheng3ce04b62015-10-26 23:30:55199 int32_t duplicate_routing_id = MSG_ROUTING_NONE;
[email protected]04cbd3d2013-12-04 04:58:20200 RenderViewHostImpl* pending_rvh =
201 PrepareToDuplicateHosts(shell(), &duplicate_routing_id);
202 EXPECT_NE(MSG_ROUTING_NONE, duplicate_routing_id);
203
204 // Since this test executes on the UI thread and hopping threads might cause
205 // different timing in the test, let's simulate a CreateNewWindow call coming
206 // from the IO thread.
207 ViewHostMsg_CreateWindow_Params params;
208 DOMStorageContextWrapper* dom_storage_context =
209 static_cast<DOMStorageContextWrapper*>(
210 BrowserContext::GetStoragePartition(
211 shell()->web_contents()->GetBrowserContext(),
212 pending_rvh->GetSiteInstance())->GetDOMStorageContext());
[email protected]4af624512013-12-13 14:58:43213 scoped_refptr<SessionStorageNamespaceImpl> session_storage(
214 new SessionStorageNamespaceImpl(dom_storage_context));
[email protected]04cbd3d2013-12-04 04:58:20215 // Cause a deliberate collision in routing ids.
dcheng3ce04b62015-10-26 23:30:55216 int32_t main_frame_routing_id = duplicate_routing_id + 1;
217 // TODO(avi): This should be made unique from the view routing ID once
218 // RenderViewHostImpl has-a RenderWidgetHostImpl. https://crbug.com/545684
219 int32_t main_frame_widget_routing_id = duplicate_routing_id;
220 pending_rvh->CreateNewWindow(duplicate_routing_id, main_frame_routing_id,
221 main_frame_widget_routing_id, params,
dcheng54c3719d2014-08-26 21:52:56222 session_storage.get());
[email protected]04cbd3d2013-12-04 04:58:20223
224 // If the above operation doesn't cause a crash, the test has succeeded!
[email protected]81374f22013-02-07 02:03:45225}
[email protected]04cbd3d2013-12-04 04:58:20226
[email protected]a8504022013-12-04 20:23:51227// This is a test for crbug.com/312016. It tries to create two RenderWidgetHosts
228// with the same process and routing ids, which causes a collision. It is almost
229// identical to the AttemptDuplicateRenderViewHost test case.
230IN_PROC_BROWSER_TEST_F(SecurityExploitBrowserTest,
231 AttemptDuplicateRenderWidgetHost) {
232 int duplicate_routing_id = MSG_ROUTING_NONE;
233 RenderViewHostImpl* pending_rvh =
234 PrepareToDuplicateHosts(shell(), &duplicate_routing_id);
235 EXPECT_NE(MSG_ROUTING_NONE, duplicate_routing_id);
236
237 // Since this test executes on the UI thread and hopping threads might cause
238 // different timing in the test, let's simulate a CreateNewWidget call coming
239 // from the IO thread. Use the existing window routing id to cause a
240 // deliberate collision.
piman5d36dae2015-09-24 22:47:05241 pending_rvh->CreateNewWidget(duplicate_routing_id, blink::WebPopupTypePage);
[email protected]a8504022013-12-04 20:23:51242
243 // If the above operation doesn't crash, the test has succeeded!
244}
245
wfh815c4872015-02-25 21:01:31246// This is a test for crbug.com/444198. It tries to send a
247// ViewHostMsg_RunFileChooser containing an invalid path. The browser should
248// correctly terminate the renderer in these cases.
249IN_PROC_BROWSER_TEST_F(SecurityExploitBrowserTest, AttemptRunFileChoosers) {
250 TestFileChooserWithPath(base::FilePath(FILE_PATH_LITERAL("../../*.txt")));
251 TestFileChooserWithPath(base::FilePath(FILE_PATH_LITERAL("/etc/*.conf")));
252#if defined(OS_WIN)
253 TestFileChooserWithPath(
254 base::FilePath(FILE_PATH_LITERAL("\\\\evilserver\\evilshare\\*.txt")));
255 TestFileChooserWithPath(base::FilePath(FILE_PATH_LITERAL("c:\\*.txt")));
256 TestFileChooserWithPath(base::FilePath(FILE_PATH_LITERAL("..\\..\\*.txt")));
257#endif
258}
259
nick4c8dfd42014-11-14 04:11:49260class SecurityExploitTestInterstitialPage : public InterstitialPageDelegate {
261 public:
262 explicit SecurityExploitTestInterstitialPage(WebContents* contents) {
263 InterstitialPage* interstitial = InterstitialPage::Create(
264 contents, true, contents->GetLastCommittedURL(), this);
265 interstitial->Show();
266 }
267
268 // InterstitialPageDelegate implementation.
269 void CommandReceived(const std::string& command) override {
270 last_command_ = command;
271 }
272
273 std::string GetHTMLContents() override {
274 return "<html><head><script>"
275 "window.domAutomationController.setAutomationId(1);"
276 "window.domAutomationController.send(\"okay\");"
277 "</script></head>"
278 "<body>this page is an interstitial</body></html>";
279 }
280
281 std::string last_command() { return last_command_; }
282
283 private:
284 std::string last_command_;
285 DISALLOW_COPY_AND_ASSIGN(SecurityExploitTestInterstitialPage);
286};
287
288// Fails due to InterstitialPage's reliance on PostNonNestableTask
289// http://crbug.com/432737
290#if defined(OS_ANDROID)
291#define MAYBE_InterstitialCommandFromUnderlyingContent \
292 DISABLED_InterstitialCommandFromUnderlyingContent
293#else
294#define MAYBE_InterstitialCommandFromUnderlyingContent \
295 InterstitialCommandFromUnderlyingContent
296#endif
297
298// The interstitial should not be controllable by the underlying content.
299IN_PROC_BROWSER_TEST_F(SecurityExploitBrowserTest,
300 MAYBE_InterstitialCommandFromUnderlyingContent) {
301 // Start off with initial navigation, to allocate the process.
302 GURL foo("http://foo.com/simple_page.html");
303 NavigateToURL(shell(), foo);
304 EXPECT_EQ(base::ASCIIToUTF16("OK"), shell()->web_contents()->GetTitle());
305
306 DOMMessageQueue message_queue;
307
308 // Install and show an interstitial page.
309 SecurityExploitTestInterstitialPage* interstitial =
310 new SecurityExploitTestInterstitialPage(shell()->web_contents());
311
312 ASSERT_EQ("", interstitial->last_command());
creis3710b2382015-08-18 00:12:15313 WaitForInterstitialAttach(shell()->web_contents());
nick4c8dfd42014-11-14 04:11:49314
315 InterstitialPage* interstitial_page =
316 shell()->web_contents()->GetInterstitialPage();
317 ASSERT_TRUE(interstitial_page != NULL);
318 ASSERT_TRUE(shell()->web_contents()->ShowingInterstitialPage());
319 ASSERT_TRUE(interstitial_page->GetDelegateForTesting() == interstitial);
320
321 // The interstitial page ought to be able to send a message.
322 std::string message;
323 ASSERT_TRUE(message_queue.WaitForMessage(&message));
324 ASSERT_EQ("\"okay\"", message);
325 ASSERT_EQ("\"okay\"", interstitial->last_command());
326
327 // Send an automation message from the underlying content and wait for it to
328 // be dispatched on this thread. This message should not be received by the
329 // interstitial.
creis3710b2382015-08-18 00:12:15330 RenderFrameHost* compromised_renderer =
nick4c8dfd42014-11-14 04:11:49331 shell()->web_contents()->GetMainFrame();
332 FrameHostMsg_DomOperationResponse evil(compromised_renderer->GetRoutingID(),
avi60bd4902015-09-23 20:39:24333 "evil");
nick4c8dfd42014-11-14 04:11:49334 IpcSecurityTestUtil::PwnMessageReceived(
335 compromised_renderer->GetProcess()->GetChannel(), evil);
336
337 ASSERT_TRUE(message_queue.WaitForMessage(&message));
338 ASSERT_EQ("evil", message)
339 << "Automation message should be received by WebContents.";
340 ASSERT_EQ("\"okay\"", interstitial->last_command())
341 << "Interstitial should not be affected.";
342
343 // Send a second message from the interstitial page, and make sure that the
344 // "evil" message doesn't arrive in the intervening period.
creis3710b2382015-08-18 00:12:15345 ASSERT_TRUE(ExecuteScript(interstitial_page->GetMainFrame(),
346 "window.domAutomationController.send(\"okay2\");"));
nick4c8dfd42014-11-14 04:11:49347 ASSERT_TRUE(message_queue.WaitForMessage(&message));
348 ASSERT_EQ("\"okay2\"", message);
349 ASSERT_EQ("\"okay2\"", interstitial->last_command());
350}
351
creis3710b2382015-08-18 00:12:15352class IsolatedAppContentBrowserClient : public TestContentBrowserClient {
353 public:
354 bool IsIllegalOrigin(content::ResourceContext* resource_context,
355 int child_process_id,
356 const GURL& origin) override {
357 // Simulate a case where an app origin is not in an app process.
358 return true;
359 }
360};
361
362// Renderer processes should not be able to spoof Origin HTTP headers.
363IN_PROC_BROWSER_TEST_F(SecurityExploitBrowserTest, InvalidOriginHeaders) {
364 // Create a set of IPC messages with various Origin headers.
365 ResourceHostMsg_Request chrome_origin_msg(
366 CreateXHRRequestWithOrigin("chrome://settings"));
367 ResourceHostMsg_Request embedder_isolated_origin_msg(
368 CreateXHRRequestWithOrigin("https://isolated.bar.com"));
369 ResourceHostMsg_Request invalid_origin_msg(
370 CreateXHRRequestWithOrigin("invalidurl"));
371 ResourceHostMsg_Request invalid_scheme_origin_msg(
372 CreateXHRRequestWithOrigin("fake-scheme://foo"));
373
374 GURL web_url("http://foo.com/simple_page.html");
375 NavigateToURL(shell(), web_url);
376 RenderFrameHost* web_rfh = shell()->web_contents()->GetMainFrame();
377
378 // Web processes cannot make XHRs with chrome:// Origin headers.
379 {
380 RenderProcessHostWatcher web_process_killed(
381 web_rfh->GetProcess(),
382 RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT);
383 IPC::IpcSecurityTestUtil::PwnMessageReceived(
384 web_rfh->GetProcess()->GetChannel(),
385 ResourceHostMsg_RequestResource(web_rfh->GetRoutingID(), 1,
386 chrome_origin_msg));
387 web_process_killed.Wait();
388 }
389
390 // Web processes cannot make XHRs with URLs that the content embedder expects
391 // to have process isolation. Ideally this would test chrome-extension://
392 // URLs for Chrome Apps, but those can't be tested inside content/ and the
393 // ResourceHostMsg_Request IPC can't be created in a test outside content/.
394 NavigateToURL(shell(), web_url);
395 {
396 // Set up a ContentBrowserClient that simulates an app URL in a non-app
397 // process.
398 IsolatedAppContentBrowserClient app_client;
399 ContentBrowserClient* old_client = SetBrowserClientForTesting(&app_client);
400 RenderProcessHostWatcher web_process_killed(
401 web_rfh->GetProcess(),
402 RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT);
403 IPC::IpcSecurityTestUtil::PwnMessageReceived(
404 web_rfh->GetProcess()->GetChannel(),
405 ResourceHostMsg_RequestResource(web_rfh->GetRoutingID(), 1,
406 embedder_isolated_origin_msg));
407 web_process_killed.Wait();
408 SetBrowserClientForTesting(old_client);
409 }
410
411 // Web processes cannot make XHRs with invalid Origin headers.
412 NavigateToURL(shell(), web_url);
413 {
414 RenderProcessHostWatcher web_process_killed(
415 web_rfh->GetProcess(),
416 RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT);
417 IPC::IpcSecurityTestUtil::PwnMessageReceived(
418 web_rfh->GetProcess()->GetChannel(),
419 ResourceHostMsg_RequestResource(web_rfh->GetRoutingID(), 1,
420 invalid_origin_msg));
421 web_process_killed.Wait();
422 }
423
424 // Web processes cannot make XHRs with invalid scheme Origin headers.
425 NavigateToURL(shell(), web_url);
426 {
427 RenderProcessHostWatcher web_process_killed(
428 web_rfh->GetProcess(),
429 RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT);
430 IPC::IpcSecurityTestUtil::PwnMessageReceived(
431 web_rfh->GetProcess()->GetChannel(),
432 ResourceHostMsg_RequestResource(web_rfh->GetRoutingID(), 1,
433 invalid_scheme_origin_msg));
434 web_process_killed.Wait();
435 }
436}
437
[email protected]04cbd3d2013-12-04 04:58:20438} // namespace content