OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/site_per_process_browsertest.h" | 5 #include "content/browser/site_per_process_browsertest.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 6283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6294 // Navigate the subframe to a blocked URL. | 6294 // Navigate the subframe to a blocked URL. |
6295 TestNavigationObserver load_observer(shell()->web_contents()); | 6295 TestNavigationObserver load_observer(shell()->web_contents()); |
6296 EXPECT_TRUE(ExecuteScript( | 6296 EXPECT_TRUE(ExecuteScript( |
6297 shell()->web_contents(), | 6297 shell()->web_contents(), |
6298 "frames[0].location.href = '" + blocked_urls[i].spec() + "';")); | 6298 "frames[0].location.href = '" + blocked_urls[i].spec() + "';")); |
6299 load_observer.Wait(); | 6299 load_observer.Wait(); |
6300 | 6300 |
6301 // The blocked frame's origin should become unique. | 6301 // The blocked frame's origin should become unique. |
6302 EXPECT_EQ("null", root->child_at(0)->current_origin().Serialize()); | 6302 EXPECT_EQ("null", root->child_at(0)->current_origin().Serialize()); |
6303 | 6303 |
| 6304 // Ensure that we don't use the blocked URL as the blocked frame's last |
| 6305 // committed URL (see https://crbug.com/622385). |
| 6306 EXPECT_NE(root->child_at(0)->current_frame_host()->GetLastCommittedURL(), |
| 6307 blocked_urls[i]); |
| 6308 |
6304 // The blocked frame should still fire a load event in its parent's process. | 6309 // The blocked frame should still fire a load event in its parent's process. |
6305 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); | 6310 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); |
6306 | 6311 |
6307 // Check that the current RenderFrameHost has stopped loading. | 6312 // Check that the current RenderFrameHost has stopped loading. |
6308 EXPECT_FALSE(root->child_at(0)->current_frame_host()->is_loading()); | 6313 EXPECT_FALSE(root->child_at(0)->current_frame_host()->is_loading()); |
6309 | 6314 |
6310 // The blocked navigation should behave like an empty 200 response. Make | 6315 // The blocked navigation should behave like an empty 200 response. Make |
6311 // sure that the frame's document.title is empty: this double-checks both | 6316 // sure that the frame's document.title is empty: this double-checks both |
6312 // that the blocked URL's contents wasn't loaded, and that the old page | 6317 // that the blocked URL's contents wasn't loaded, and that the old page |
6313 // isn't active anymore (both of these pages have non-empty titles). | 6318 // isn't active anymore (both of these pages have non-empty titles). |
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7208 EXPECT_TRUE(is_fullscreen_allowed(root->child_at(0))); | 7213 EXPECT_TRUE(is_fullscreen_allowed(root->child_at(0))); |
7209 EXPECT_TRUE(is_fullscreen_allowed(root->child_at(0)->child_at(0))); | 7214 EXPECT_TRUE(is_fullscreen_allowed(root->child_at(0)->child_at(0))); |
7210 | 7215 |
7211 // Cross-site navigation should preserve the fullscreen flags. | 7216 // Cross-site navigation should preserve the fullscreen flags. |
7212 NavigateFrameToURL(root->child_at(0)->child_at(0), | 7217 NavigateFrameToURL(root->child_at(0)->child_at(0), |
7213 embedded_test_server()->GetURL("d.com", "/title1.html")); | 7218 embedded_test_server()->GetURL("d.com", "/title1.html")); |
7214 EXPECT_TRUE(is_fullscreen_allowed(root->child_at(0)->child_at(0))); | 7219 EXPECT_TRUE(is_fullscreen_allowed(root->child_at(0)->child_at(0))); |
7215 } | 7220 } |
7216 | 7221 |
7217 } // namespace content | 7222 } // namespace content |
OLD | NEW |