Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Side by Side Diff: content/browser/site_per_process_browsertest.cc

Issue 2854723002: Network service: avoid requesting a new URLLoaderFactory for each NavigationURLLoaderNetworkService. (Closed)
Patch Set: . Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/loader/navigation_url_loader_network_service.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/browser/loader/navigation_url_loader_network_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698