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 7012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7023 root->child_at(0)->current_frame_host()->GetSiteInstance()); | 7023 root->child_at(0)->current_frame_host()->GetSiteInstance()); |
7024 EXPECT_TRUE(rvh->is_swapped_out_); | 7024 EXPECT_TRUE(rvh->is_swapped_out_); |
7025 | 7025 |
7026 // Have the child frame navigate its parent to its SiteInstance. | 7026 // Have the child frame navigate its parent to its SiteInstance. |
7027 GURL b_url(embedded_test_server()->GetURL("b.com", "/title1.html")); | 7027 GURL b_url(embedded_test_server()->GetURL("b.com", "/title1.html")); |
7028 std::string script = base::StringPrintf( | 7028 std::string script = base::StringPrintf( |
7029 "window.domAutomationController.send(" | 7029 "window.domAutomationController.send(" |
7030 "parent.location = '%s');", | 7030 "parent.location = '%s');", |
7031 b_url.spec().c_str()); | 7031 b_url.spec().c_str()); |
7032 | 7032 |
| 7033 // Ensure the child has received a user gesture, so that it has permission |
| 7034 // to framebust. |
| 7035 SimulateMouseClick( |
| 7036 root->child_at(0)->current_frame_host()->GetRenderWidgetHost(), 1, 1); |
7033 TestFrameNavigationObserver frame_observer(root); | 7037 TestFrameNavigationObserver frame_observer(root); |
7034 EXPECT_TRUE(ExecuteScript(root->child_at(0), script)); | 7038 EXPECT_TRUE(ExecuteScript(root->child_at(0), script)); |
7035 frame_observer.Wait(); | 7039 frame_observer.Wait(); |
7036 EXPECT_EQ(b_url, root->current_url()); | 7040 EXPECT_EQ(b_url, root->current_url()); |
7037 | 7041 |
7038 // Verify that the same RenderViewHost is preserved and that it is no longer | 7042 // Verify that the same RenderViewHost is preserved and that it is no longer |
7039 // in swapped out state. | 7043 // in swapped out state. |
7040 EXPECT_EQ(rvh, contents->GetFrameTree()->GetRenderViewHost( | 7044 EXPECT_EQ(rvh, contents->GetFrameTree()->GetRenderViewHost( |
7041 root->current_frame_host()->GetSiteInstance())); | 7045 root->current_frame_host()->GetSiteInstance())); |
7042 EXPECT_FALSE(rvh->is_swapped_out_); | 7046 EXPECT_FALSE(rvh->is_swapped_out_); |
(...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8224 " Site A ------------ proxies for B C\n" | 8228 " Site A ------------ proxies for B C\n" |
8225 " +--Site B ------- proxies for A C\n" | 8229 " +--Site B ------- proxies for A C\n" |
8226 " +--Site C -- proxies for A B\n" | 8230 " +--Site C -- proxies for A B\n" |
8227 "Where A = http://a.com/\n" | 8231 "Where A = http://a.com/\n" |
8228 " B = http://b.com/\n" | 8232 " B = http://b.com/\n" |
8229 " C = http://c.com/", | 8233 " C = http://c.com/", |
8230 DepictFrameTree(root)); | 8234 DepictFrameTree(root)); |
8231 } | 8235 } |
8232 | 8236 |
8233 } // namespace content | 8237 } // namespace content |
OLD | NEW |