Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(698)

Side by Side Diff: content/browser/security_exploit_browsertest.cc

Issue 740813004: Use StopChildProcess instead of base::KillProcess to kill a renderer process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comments Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 // create arbitrary SiteInstances. 103 // create arbitrary SiteInstances.
104 command_line->AppendSwitchASCII( 104 command_line->AppendSwitchASCII(
105 switches::kHostResolverRules, 105 switches::kHostResolverRules,
106 "MAP * " + 106 "MAP * " +
107 net::HostPortPair::FromURL(embedded_test_server()->base_url()) 107 net::HostPortPair::FromURL(embedded_test_server()->base_url())
108 .ToString() + 108 .ToString() +
109 ",EXCLUDE localhost"); 109 ",EXCLUDE localhost");
110 } 110 }
111 }; 111 };
112 112
113 // Fails because the process kill on Android does not succeed.
114 // http://crbug.com/433068
115 #if defined(OS_ANDROID)
116 #define MAYBE_SetWebUIProperty DISABLED_SetWebUIProperty
117 #else
118 #define MAYBE_SetWebUIProperty SetWebUIProperty
119 #endif
120
121 // Ensure that we kill the renderer process if we try to give it WebUI 113 // Ensure that we kill the renderer process if we try to give it WebUI
122 // properties and it doesn't have enabled WebUI bindings. 114 // properties and it doesn't have enabled WebUI bindings.
123 IN_PROC_BROWSER_TEST_F(SecurityExploitBrowserTest, MAYBE_SetWebUIProperty) { 115 IN_PROC_BROWSER_TEST_F(SecurityExploitBrowserTest, SetWebUIProperty) {
124 GURL foo("http://foo.com/simple_page.html"); 116 GURL foo("http://foo.com/simple_page.html");
125 117
126 NavigateToURL(shell(), foo); 118 NavigateToURL(shell(), foo);
127 EXPECT_EQ(base::ASCIIToUTF16("OK"), shell()->web_contents()->GetTitle()); 119 EXPECT_EQ(base::ASCIIToUTF16("OK"), shell()->web_contents()->GetTitle());
128 EXPECT_EQ(0, 120 EXPECT_EQ(0,
129 shell()->web_contents()->GetRenderViewHost()->GetEnabledBindings()); 121 shell()->web_contents()->GetRenderViewHost()->GetEnabledBindings());
130 122
131 content::RenderProcessHostWatcher terminated( 123 content::RenderProcessHostWatcher terminated(
132 shell()->web_contents(), 124 shell()->web_contents(),
133 content::RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); 125 content::RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT);
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 // "evil" message doesn't arrive in the intervening period. 267 // "evil" message doesn't arrive in the intervening period.
276 ASSERT_TRUE(content::ExecuteScript( 268 ASSERT_TRUE(content::ExecuteScript(
277 interstitial_page->GetRenderViewHostForTesting(), 269 interstitial_page->GetRenderViewHostForTesting(),
278 "window.domAutomationController.send(\"okay2\");")); 270 "window.domAutomationController.send(\"okay2\");"));
279 ASSERT_TRUE(message_queue.WaitForMessage(&message)); 271 ASSERT_TRUE(message_queue.WaitForMessage(&message));
280 ASSERT_EQ("\"okay2\"", message); 272 ASSERT_EQ("\"okay2\"", message);
281 ASSERT_EQ("\"okay2\"", interstitial->last_command()); 273 ASSERT_EQ("\"okay2\"", interstitial->last_command());
282 } 274 }
283 275
284 } // namespace content 276 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.cc ('k') | content/browser/site_per_process_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698