| 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 2547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2558 // last successful url should be empty (since the frame only loaded an error | 2558 // last successful url should be empty (since the frame only loaded an error |
| 2559 // page). | 2559 // page). |
| 2560 if (IsBrowserSideNavigationEnabled()) | 2560 if (IsBrowserSideNavigationEnabled()) |
| 2561 EXPECT_EQ(GURL(), child->current_frame_host()->last_successful_url()); | 2561 EXPECT_EQ(GURL(), child->current_frame_host()->last_successful_url()); |
| 2562 else | 2562 else |
| 2563 EXPECT_EQ(url_a, child->current_frame_host()->last_successful_url()); | 2563 EXPECT_EQ(url_a, child->current_frame_host()->last_successful_url()); |
| 2564 EXPECT_EQ(url_b, child->current_url()); | 2564 EXPECT_EQ(url_b, child->current_url()); |
| 2565 EXPECT_EQ("null", child->current_origin().Serialize()); | 2565 EXPECT_EQ("null", child->current_origin().Serialize()); |
| 2566 | 2566 |
| 2567 // Try again after re-enabling host resolution. | 2567 // Try again after re-enabling host resolution. |
| 2568 if (!network_service) | 2568 if (network_service) { |
| 2569 NavigationURLLoaderNetworkService::OverrideURLLoaderFactoryForTesting( |
| 2570 nullptr); |
| 2571 } else { |
| 2569 host_resolver()->AddRule("*", "127.0.0.1"); | 2572 host_resolver()->AddRule("*", "127.0.0.1"); |
| 2573 } |
| 2570 | 2574 |
| 2571 NavigateIframeToURL(shell()->web_contents(), "child-0", url_b); | 2575 NavigateIframeToURL(shell()->web_contents(), "child-0", url_b); |
| 2572 EXPECT_TRUE(observer.last_navigation_succeeded()); | 2576 EXPECT_TRUE(observer.last_navigation_succeeded()); |
| 2573 EXPECT_EQ(url_b, observer.last_navigation_url()); | 2577 EXPECT_EQ(url_b, observer.last_navigation_url()); |
| 2574 | 2578 |
| 2575 // The FrameTreeNode should have updated its URL and origin. | 2579 // The FrameTreeNode should have updated its URL and origin. |
| 2576 EXPECT_EQ(url_b, child->current_frame_host()->last_successful_url()); | 2580 EXPECT_EQ(url_b, child->current_frame_host()->last_successful_url()); |
| 2577 EXPECT_EQ(url_b, child->current_url()); | 2581 EXPECT_EQ(url_b, child->current_url()); |
| 2578 EXPECT_EQ(url_b.GetOrigin().spec(), | 2582 EXPECT_EQ(url_b.GetOrigin().spec(), |
| 2579 child->current_origin().Serialize() + '/'); | 2583 child->current_origin().Serialize() + '/'); |
| (...skipping 7580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10160 names.insert(root->children[0]->frame_entry->frame_unique_name()); | 10164 names.insert(root->children[0]->frame_entry->frame_unique_name()); |
| 10161 } | 10165 } |
| 10162 | 10166 |
| 10163 // More than one entry in the set means that the subframe frame navigation | 10167 // More than one entry in the set means that the subframe frame navigation |
| 10164 // entries didn't have a consistent unique name. This will break history | 10168 // entries didn't have a consistent unique name. This will break history |
| 10165 // navigations =( | 10169 // navigations =( |
| 10166 EXPECT_THAT(names, SizeIs(1)) << "Mismatched names for subframe!"; | 10170 EXPECT_THAT(names, SizeIs(1)) << "Mismatched names for subframe!"; |
| 10167 } | 10171 } |
| 10168 | 10172 |
| 10169 } // namespace content | 10173 } // namespace content |
| OLD | NEW |