OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
8 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 8 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
9 #include "chrome/test/base/in_process_browser_test.h" | 9 #include "chrome/test/base/in_process_browser_test.h" |
10 #include "chrome/test/base/ui_test_utils.h" | 10 #include "chrome/test/base/ui_test_utils.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
90 EXPECT_TRUE(ExecuteScriptAndExtractBool( | 90 EXPECT_TRUE(ExecuteScriptAndExtractBool( |
91 frame_host, | 91 frame_host, |
92 "window.domAutomationController.send(!!openDatabase(" | 92 "window.domAutomationController.send(!!openDatabase(" |
93 "'foodb', '1.0', 'Test DB', 1024));", | 93 "'foodb', '1.0', 'Test DB', 1024));", |
94 &is_object_created)); | 94 &is_object_created)); |
95 EXPECT_TRUE(is_object_created); | 95 EXPECT_TRUE(is_object_created); |
96 EXPECT_TRUE(ExecuteScript(frame_host, | 96 EXPECT_TRUE(ExecuteScript(frame_host, |
97 "window.webkitRequestFileSystem(" | 97 "window.webkitRequestFileSystem(" |
98 "window.TEMPORARY, 1024, function() {});")); | 98 "window.TEMPORARY, 1024, function() {});")); |
99 } | 99 } |
100 | |
101 // Ensure that creating a plugin in a cross-site subframe doesn't crash. This | |
102 // involves querying content settings from the renderer process and using the | |
103 // top frame's origin as one of the parameters. See https://crbug.com/426658. | |
104 IN_PROC_BROWSER_TEST_F(ChromeSitePerProcessTest, PluginWithRemoteTopFrame) { | |
105 GURL main_url(embedded_test_server()->GetURL("a.com", "/iframe.html")); | |
106 ui_test_utils::NavigateToURL(browser(), main_url); | |
107 | |
108 // Navigate subframe to a page with a Flash object. | |
109 content::WebContents* active_web_contents = | |
110 browser()->tab_strip_model()->GetActiveWebContents(); | |
111 GURL frame_url = embedded_test_server()->GetURL("b.com", "/object.html"); | |
nasko
2015/08/20 20:44:23
nit: flash_object.html, as object.html is a bit to
alexmos
2015/08/20 21:23:44
Done.
| |
112 content::DOMMessageQueue msg_queue; | |
113 EXPECT_TRUE(NavigateIframeToURL(active_web_contents, "test", frame_url)); | |
114 | |
115 // Ensure the page finishes loading without crashing. | |
116 std::string status; | |
117 while (msg_queue.WaitForMessage(&status)) { | |
118 if (status == "\"DONE\"") | |
119 break; | |
120 } | |
121 } | |
OLD | NEW |