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

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

Issue 2566583002: Change allowed bindings to be per RenderFrame instead of per RenderView. (Closed)
Patch Set: Created 3 years, 11 months 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/containers/hash_tables.h" 8 #include "base/containers/hash_tables.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 terminated.Wait(); 228 terminated.Wait();
229 } 229 }
230 230
231 // Ensure that we kill the renderer process if we try to give it WebUI 231 // Ensure that we kill the renderer process if we try to give it WebUI
232 // properties and it doesn't have enabled WebUI bindings. 232 // properties and it doesn't have enabled WebUI bindings.
233 IN_PROC_BROWSER_TEST_F(SecurityExploitBrowserTest, SetWebUIProperty) { 233 IN_PROC_BROWSER_TEST_F(SecurityExploitBrowserTest, SetWebUIProperty) {
234 GURL foo("http://foo.com/simple_page.html"); 234 GURL foo("http://foo.com/simple_page.html");
235 235
236 NavigateToURL(shell(), foo); 236 NavigateToURL(shell(), foo);
237 EXPECT_EQ(base::ASCIIToUTF16("OK"), shell()->web_contents()->GetTitle()); 237 EXPECT_EQ(base::ASCIIToUTF16("OK"), shell()->web_contents()->GetTitle());
238 EXPECT_EQ(0, 238 EXPECT_EQ(0, shell()->web_contents()->GetMainFrame()->GetEnabledBindings());
239 shell()->web_contents()->GetRenderViewHost()->GetEnabledBindings());
240 239
241 RenderProcessHostWatcher terminated( 240 RenderProcessHostWatcher terminated(
242 shell()->web_contents(), 241 shell()->web_contents(),
243 RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); 242 RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT);
244 shell()->web_contents()->GetRenderViewHost()->SetWebUIProperty( 243 shell()->web_contents()->GetRenderViewHost()->SetWebUIProperty(
245 "toolkit", "views"); 244 "toolkit", "views");
246 terminated.Wait(); 245 terminated.Wait();
247 } 246 }
248 247
249 // This is a test for crbug.com/312016 attempting to create duplicate 248 // This is a test for crbug.com/312016 attempting to create duplicate
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 // separate task of the message loop, so ensure that the process is still 552 // separate task of the message loop, so ensure that the process is still
554 // considered alive. 553 // considered alive.
555 EXPECT_TRUE(root->current_frame_host()->GetProcess()->HasConnection()); 554 EXPECT_TRUE(root->current_frame_host()->GetProcess()->HasConnection());
556 555
557 exit_observer.Wait(); 556 exit_observer.Wait();
558 EXPECT_FALSE(exit_observer.did_exit_normally()); 557 EXPECT_FALSE(exit_observer.did_exit_normally());
559 ResourceDispatcherHost::Get()->SetDelegate(nullptr); 558 ResourceDispatcherHost::Get()->SetDelegate(nullptr);
560 } 559 }
561 560
562 } // namespace content 561 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698