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 6796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6807 TestNavigationObserver load_observer(shell()->web_contents()); | 6807 TestNavigationObserver load_observer(shell()->web_contents()); |
6808 EXPECT_TRUE(ExecuteScript(shell(), "frames[0].location.href = '" + | 6808 EXPECT_TRUE(ExecuteScript(shell(), "frames[0].location.href = '" + |
6809 blocked_urls[i].spec() + "';")); | 6809 blocked_urls[i].spec() + "';")); |
6810 load_observer.Wait(); | 6810 load_observer.Wait(); |
6811 | 6811 |
6812 // The blocked frame's origin should become unique. | 6812 // The blocked frame's origin should become unique. |
6813 EXPECT_EQ("null", root->child_at(0)->current_origin().Serialize()); | 6813 EXPECT_EQ("null", root->child_at(0)->current_origin().Serialize()); |
6814 | 6814 |
6815 // Ensure that we don't use the blocked URL as the blocked frame's last | 6815 // Ensure that we don't use the blocked URL as the blocked frame's last |
6816 // committed URL (see https://crbug.com/622385). | 6816 // committed URL (see https://crbug.com/622385). |
6817 EXPECT_NE(root->child_at(0)->current_frame_host()->GetLastCommittedURL(), | 6817 EXPECT_NE(root->child_at(0)->current_frame_host()->last_successful_url(), |
6818 blocked_urls[i]); | 6818 blocked_urls[i]); |
6819 | 6819 |
6820 // The blocked frame should still fire a load event in its parent's process. | 6820 // The blocked frame should still fire a load event in its parent's process. |
6821 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); | 6821 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); |
6822 | 6822 |
6823 // Check that the current RenderFrameHost has stopped loading. | 6823 // Check that the current RenderFrameHost has stopped loading. |
6824 EXPECT_FALSE(root->child_at(0)->current_frame_host()->is_loading()); | 6824 EXPECT_FALSE(root->child_at(0)->current_frame_host()->is_loading()); |
6825 | 6825 |
6826 // The blocked navigation should behave like an empty 200 response. Make | 6826 // The blocked navigation should behave like an empty 200 response. Make |
6827 // sure that the frame's document.title is empty: this double-checks both | 6827 // sure that the frame's document.title is empty: this double-checks both |
(...skipping 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8516 EXPECT_TRUE(NavigateToURL(shell(), b_url)); | 8516 EXPECT_TRUE(NavigateToURL(shell(), b_url)); |
8517 | 8517 |
8518 base::string16 expected_title(base::UTF8ToUTF16("foo")); | 8518 base::string16 expected_title(base::UTF8ToUTF16("foo")); |
8519 TitleWatcher title_watcher(popup2->web_contents(), expected_title); | 8519 TitleWatcher title_watcher(popup2->web_contents(), expected_title); |
8520 EXPECT_TRUE(ExecuteScript( | 8520 EXPECT_TRUE(ExecuteScript( |
8521 shell(), "window.open('','popup2').postMessage('foo', '*');")); | 8521 shell(), "window.open('','popup2').postMessage('foo', '*');")); |
8522 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); | 8522 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); |
8523 } | 8523 } |
8524 | 8524 |
8525 } // namespace content | 8525 } // namespace content |
OLD | NEW |