| 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 <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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 terminated.Wait(); | 236 terminated.Wait(); |
| 237 } | 237 } |
| 238 | 238 |
| 239 // Ensure that we kill the renderer process if we try to give it WebUI | 239 // Ensure that we kill the renderer process if we try to give it WebUI |
| 240 // properties and it doesn't have enabled WebUI bindings. | 240 // properties and it doesn't have enabled WebUI bindings. |
| 241 IN_PROC_BROWSER_TEST_F(SecurityExploitBrowserTest, SetWebUIProperty) { | 241 IN_PROC_BROWSER_TEST_F(SecurityExploitBrowserTest, SetWebUIProperty) { |
| 242 GURL foo("http://foo.com/simple_page.html"); | 242 GURL foo("http://foo.com/simple_page.html"); |
| 243 | 243 |
| 244 NavigateToURL(shell(), foo); | 244 NavigateToURL(shell(), foo); |
| 245 EXPECT_EQ(base::ASCIIToUTF16("OK"), shell()->web_contents()->GetTitle()); | 245 EXPECT_EQ(base::ASCIIToUTF16("OK"), shell()->web_contents()->GetTitle()); |
| 246 EXPECT_EQ(0, | 246 EXPECT_EQ(0, shell()->web_contents()->GetMainFrame()->GetEnabledBindings()); |
| 247 shell()->web_contents()->GetRenderViewHost()->GetEnabledBindings()); | |
| 248 | 247 |
| 249 RenderProcessHostWatcher terminated( | 248 RenderProcessHostWatcher terminated( |
| 250 shell()->web_contents(), | 249 shell()->web_contents(), |
| 251 RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); | 250 RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); |
| 252 shell()->web_contents()->GetRenderViewHost()->SetWebUIProperty( | 251 shell()->web_contents()->GetRenderViewHost()->SetWebUIProperty( |
| 253 "toolkit", "views"); | 252 "toolkit", "views"); |
| 254 terminated.Wait(); | 253 terminated.Wait(); |
| 255 } | 254 } |
| 256 | 255 |
| 257 // This is a test for crbug.com/312016 attempting to create duplicate | 256 // This is a test for crbug.com/312016 attempting to create duplicate |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 // separate task of the message loop, so ensure that the process is still | 560 // separate task of the message loop, so ensure that the process is still |
| 562 // considered alive. | 561 // considered alive. |
| 563 EXPECT_TRUE(root->current_frame_host()->GetProcess()->HasConnection()); | 562 EXPECT_TRUE(root->current_frame_host()->GetProcess()->HasConnection()); |
| 564 | 563 |
| 565 exit_observer.Wait(); | 564 exit_observer.Wait(); |
| 566 EXPECT_FALSE(exit_observer.did_exit_normally()); | 565 EXPECT_FALSE(exit_observer.did_exit_normally()); |
| 567 ResourceDispatcherHost::Get()->SetDelegate(nullptr); | 566 ResourceDispatcherHost::Get()->SetDelegate(nullptr); |
| 568 } | 567 } |
| 569 | 568 |
| 570 } // namespace content | 569 } // namespace content |
| OLD | NEW |