| 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 6280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6291 // Navigate the subframe to a blocked URL. | 6291 // Navigate the subframe to a blocked URL. |
| 6292 TestNavigationObserver load_observer(shell()->web_contents()); | 6292 TestNavigationObserver load_observer(shell()->web_contents()); |
| 6293 EXPECT_TRUE(ExecuteScript( | 6293 EXPECT_TRUE(ExecuteScript( |
| 6294 shell()->web_contents(), | 6294 shell()->web_contents(), |
| 6295 "frames[0].location.href = '" + blocked_urls[i].spec() + "';")); | 6295 "frames[0].location.href = '" + blocked_urls[i].spec() + "';")); |
| 6296 load_observer.Wait(); | 6296 load_observer.Wait(); |
| 6297 | 6297 |
| 6298 // The blocked frame's origin should become unique. | 6298 // The blocked frame's origin should become unique. |
| 6299 EXPECT_EQ("null", root->child_at(0)->current_origin().Serialize()); | 6299 EXPECT_EQ("null", root->child_at(0)->current_origin().Serialize()); |
| 6300 | 6300 |
| 6301 // Ensure that we don't use the blocked URL as the blocked frame's last |
| 6302 // committed URL (see https://crbug.com/622385). |
| 6303 EXPECT_NE(root->child_at(0)->current_frame_host()->GetLastCommittedURL(), |
| 6304 blocked_urls[i]); |
| 6305 |
| 6301 // The blocked frame should still fire a load event in its parent's process. | 6306 // The blocked frame should still fire a load event in its parent's process. |
| 6302 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); | 6307 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); |
| 6303 | 6308 |
| 6304 // Check that the current RenderFrameHost has stopped loading. | 6309 // Check that the current RenderFrameHost has stopped loading. |
| 6305 EXPECT_FALSE(root->child_at(0)->current_frame_host()->is_loading()); | 6310 EXPECT_FALSE(root->child_at(0)->current_frame_host()->is_loading()); |
| 6306 | 6311 |
| 6307 // The blocked navigation should behave like an empty 200 response. Make | 6312 // The blocked navigation should behave like an empty 200 response. Make |
| 6308 // sure that the frame's document.title is empty: this double-checks both | 6313 // sure that the frame's document.title is empty: this double-checks both |
| 6309 // that the blocked URL's contents wasn't loaded, and that the old page | 6314 // that the blocked URL's contents wasn't loaded, and that the old page |
| 6310 // isn't active anymore (both of these pages have non-empty titles). | 6315 // isn't active anymore (both of these pages have non-empty titles). |
| (...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6926 | 6931 |
| 6927 EXPECT_EQ( | 6932 EXPECT_EQ( |
| 6928 " Site A ------------ proxies for B\n" | 6933 " Site A ------------ proxies for B\n" |
| 6929 " +--Site B ------- proxies for A\n" | 6934 " +--Site B ------- proxies for A\n" |
| 6930 "Where A = http://a.com/\n" | 6935 "Where A = http://a.com/\n" |
| 6931 " B = http://b.com/", | 6936 " B = http://b.com/", |
| 6932 DepictFrameTree(root)); | 6937 DepictFrameTree(root)); |
| 6933 } | 6938 } |
| 6934 | 6939 |
| 6935 } // namespace content | 6940 } // namespace content |
| OLD | NEW |