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 6886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6897 TestNavigationObserver load_observer(shell()->web_contents()); | 6897 TestNavigationObserver load_observer(shell()->web_contents()); |
6898 EXPECT_TRUE(ExecuteScript(shell(), "frames[0].location.href = '" + | 6898 EXPECT_TRUE(ExecuteScript(shell(), "frames[0].location.href = '" + |
6899 blocked_urls[i].spec() + "';")); | 6899 blocked_urls[i].spec() + "';")); |
6900 load_observer.Wait(); | 6900 load_observer.Wait(); |
6901 | 6901 |
6902 // The blocked frame's origin should become unique. | 6902 // The blocked frame's origin should become unique. |
6903 EXPECT_EQ("null", root->child_at(0)->current_origin().Serialize()); | 6903 EXPECT_EQ("null", root->child_at(0)->current_origin().Serialize()); |
6904 | 6904 |
6905 // Ensure that we don't use the blocked URL as the blocked frame's last | 6905 // Ensure that we don't use the blocked URL as the blocked frame's last |
6906 // committed URL (see https://crbug.com/622385). | 6906 // committed URL (see https://crbug.com/622385). |
6907 EXPECT_NE(root->child_at(0)->current_frame_host()->GetLastCommittedURL(), | 6907 EXPECT_NE(root->child_at(0)->current_frame_host()->last_successful_url(), |
6908 blocked_urls[i]); | 6908 blocked_urls[i]); |
6909 | 6909 |
6910 // The blocked frame should still fire a load event in its parent's process. | 6910 // The blocked frame should still fire a load event in its parent's process. |
6911 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); | 6911 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); |
6912 | 6912 |
6913 // Check that the current RenderFrameHost has stopped loading. | 6913 // Check that the current RenderFrameHost has stopped loading. |
6914 EXPECT_FALSE(root->child_at(0)->current_frame_host()->is_loading()); | 6914 EXPECT_FALSE(root->child_at(0)->current_frame_host()->is_loading()); |
6915 | 6915 |
6916 // The blocked navigation should behave like an empty 200 response. Make | 6916 // The blocked navigation should behave like an empty 200 response. Make |
6917 // sure that the frame's document.title is empty: this double-checks both | 6917 // sure that the frame's document.title is empty: this double-checks both |
(...skipping 1880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8798 | 8798 |
8799 // Ensure that the iframe reuses its parent's process. | 8799 // Ensure that the iframe reuses its parent's process. |
8800 EXPECT_EQ(blank_url, child->current_url()); | 8800 EXPECT_EQ(blank_url, child->current_url()); |
8801 EXPECT_EQ(root->current_frame_host()->GetSiteInstance(), | 8801 EXPECT_EQ(root->current_frame_host()->GetSiteInstance(), |
8802 child->current_frame_host()->GetSiteInstance()); | 8802 child->current_frame_host()->GetSiteInstance()); |
8803 EXPECT_EQ(root->current_frame_host()->GetProcess(), | 8803 EXPECT_EQ(root->current_frame_host()->GetProcess(), |
8804 child->current_frame_host()->GetProcess()); | 8804 child->current_frame_host()->GetProcess()); |
8805 } | 8805 } |
8806 | 8806 |
8807 } // namespace content | 8807 } // namespace content |
OLD | NEW |