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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 GURL main_url(embedded_test_server()->GetURL( | 47 GURL main_url(embedded_test_server()->GetURL( |
48 "a.com", | 48 "a.com", |
49 "/frame_tree/page_with_two_frames_remote_and_local.html")); | 49 "/frame_tree/page_with_two_frames_remote_and_local.html")); |
50 ui_test_utils::NavigateToURL(browser(), main_url); | 50 ui_test_utils::NavigateToURL(browser(), main_url); |
51 } | 51 } |
52 | 52 |
53 // Verify that origin replication allows JS access to localStorage, database, | 53 // Verify that origin replication allows JS access to localStorage, database, |
54 // and FileSystem APIs. These features involve a check on the | 54 // and FileSystem APIs. These features involve a check on the |
55 // WebSecurityOrigin of the topmost WebFrame in ContentSettingsObserver, and | 55 // WebSecurityOrigin of the topmost WebFrame in ContentSettingsObserver, and |
56 // this test ensures this check works when the top frame is remote. | 56 // this test ensures this check works when the top frame is remote. |
57 // | |
58 // Disabled due to a shutdown race condition that can lead to UAF in the | |
59 // renderer (https://crbug.com/470055). | |
60 IN_PROC_BROWSER_TEST_F(ChromeSitePerProcessTest, | 57 IN_PROC_BROWSER_TEST_F(ChromeSitePerProcessTest, |
61 DISABLED_OriginReplicationAllowsAccessToStorage) { | 58 OriginReplicationAllowsAccessToStorage) { |
62 // Navigate to a page with a same-site iframe. | 59 // Navigate to a page with a same-site iframe. |
63 GURL main_url(embedded_test_server()->GetURL("a.com", "/iframe.html")); | 60 GURL main_url(embedded_test_server()->GetURL("a.com", "/iframe.html")); |
64 ui_test_utils::NavigateToURL(browser(), main_url); | 61 ui_test_utils::NavigateToURL(browser(), main_url); |
65 | 62 |
66 // Navigate subframe cross-site. | 63 // Navigate subframe cross-site. |
67 content::WebContents* active_web_contents = | 64 content::WebContents* active_web_contents = |
68 browser()->tab_strip_model()->GetActiveWebContents(); | 65 browser()->tab_strip_model()->GetActiveWebContents(); |
69 GURL cross_site_url(embedded_test_server()->GetURL("b.com", "/title2.html")); | 66 GURL cross_site_url(embedded_test_server()->GetURL("b.com", "/title2.html")); |
70 EXPECT_TRUE(NavigateIframeToURL(active_web_contents, "test", cross_site_url)); | 67 EXPECT_TRUE(NavigateIframeToURL(active_web_contents, "test", cross_site_url)); |
71 | 68 |
(...skipping 22 matching lines...) Expand all Loading... |
94 EXPECT_TRUE(ExecuteScriptAndExtractBool( | 91 EXPECT_TRUE(ExecuteScriptAndExtractBool( |
95 frame_host, | 92 frame_host, |
96 "window.domAutomationController.send(!!openDatabase(" | 93 "window.domAutomationController.send(!!openDatabase(" |
97 "'foodb', '1.0', 'Test DB', 1024));", | 94 "'foodb', '1.0', 'Test DB', 1024));", |
98 &is_object_created)); | 95 &is_object_created)); |
99 EXPECT_TRUE(is_object_created); | 96 EXPECT_TRUE(is_object_created); |
100 EXPECT_TRUE(ExecuteScript(frame_host, | 97 EXPECT_TRUE(ExecuteScript(frame_host, |
101 "window.webkitRequestFileSystem(" | 98 "window.webkitRequestFileSystem(" |
102 "window.TEMPORARY, 1024, function() {});")); | 99 "window.TEMPORARY, 1024, function() {});")); |
103 } | 100 } |
OLD | NEW |