OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/frame_host/navigation_controller_impl.h" | 5 #include "content/browser/frame_host/navigation_controller_impl.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 2586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2597 controller.GetLastCommittedEntry()->GetFrameEntry(foo_subframe); | 2597 controller.GetLastCommittedEntry()->GetFrameEntry(foo_subframe); |
2598 std::string named_subframe_name = "foo"; | 2598 std::string named_subframe_name = "foo"; |
2599 EXPECT_EQ(named_subframe_name, foo_subframe_entry->frame_unique_name()); | 2599 EXPECT_EQ(named_subframe_name, foo_subframe_entry->frame_unique_name()); |
2600 | 2600 |
2601 // 4. Navigating in the subframes cross-process shouldn't change their names. | 2601 // 4. Navigating in the subframes cross-process shouldn't change their names. |
2602 // TODO(creis): Fix the unnamed case in https://crbug.com/502317. | 2602 // TODO(creis): Fix the unnamed case in https://crbug.com/502317. |
2603 GURL bar_url(embedded_test_server()->GetURL( | 2603 GURL bar_url(embedded_test_server()->GetURL( |
2604 "bar.com", "/navigation_controller/simple_page_1.html")); | 2604 "bar.com", "/navigation_controller/simple_page_1.html")); |
2605 NavigateFrameToURL(foo_subframe, bar_url); | 2605 NavigateFrameToURL(foo_subframe, bar_url); |
2606 EXPECT_TRUE(WaitForLoadStop(shell()->web_contents())); | 2606 EXPECT_TRUE(WaitForLoadStop(shell()->web_contents())); |
2607 EXPECT_NE(main_site_instance, | 2607 |
2608 foo_subframe->current_frame_host()->GetSiteInstance()); | 2608 // When run just with subframe navigation entries enabled and not in |
| 2609 // site-per-process-mode the subframe should be in the same SiteInstance as |
| 2610 // its parent. |
| 2611 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible()) { |
| 2612 EXPECT_EQ(main_site_instance, |
| 2613 foo_subframe->current_frame_host()->GetSiteInstance()); |
| 2614 } else { |
| 2615 EXPECT_NE(main_site_instance, |
| 2616 foo_subframe->current_frame_host()->GetSiteInstance()); |
| 2617 } |
| 2618 |
2609 foo_subframe_entry = | 2619 foo_subframe_entry = |
2610 controller.GetLastCommittedEntry()->GetFrameEntry(foo_subframe); | 2620 controller.GetLastCommittedEntry()->GetFrameEntry(foo_subframe); |
2611 EXPECT_EQ(named_subframe_name, foo_subframe_entry->frame_unique_name()); | 2621 EXPECT_EQ(named_subframe_name, foo_subframe_entry->frame_unique_name()); |
2612 } | 2622 } |
2613 | 2623 |
2614 // Verifies that item sequence numbers and document sequence numbers update | 2624 // Verifies that item sequence numbers and document sequence numbers update |
2615 // properly for main frames and subframes. | 2625 // properly for main frames and subframes. |
2616 IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, | 2626 IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, |
2617 FrameNavigationEntry_SequenceNumbers) { | 2627 FrameNavigationEntry_SequenceNumbers) { |
2618 const NavigationControllerImpl& controller = | 2628 const NavigationControllerImpl& controller = |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3187 EXPECT_EQ(original_url, capturer.all_params()[1].url); | 3197 EXPECT_EQ(original_url, capturer.all_params()[1].url); |
3188 EXPECT_EQ(original_url, shell()->web_contents()->GetLastCommittedURL()); | 3198 EXPECT_EQ(original_url, shell()->web_contents()->GetLastCommittedURL()); |
3189 } | 3199 } |
3190 | 3200 |
3191 // Make sure the renderer is still alive. | 3201 // Make sure the renderer is still alive. |
3192 EXPECT_TRUE( | 3202 EXPECT_TRUE( |
3193 ExecuteScript(shell()->web_contents(), "console.log('Success');")); | 3203 ExecuteScript(shell()->web_contents(), "console.log('Success');")); |
3194 } | 3204 } |
3195 | 3205 |
3196 } // namespace content | 3206 } // namespace content |
OLD | NEW |