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

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

Issue 2919313004: Get rid of URLLoaderFactory in browser-side case (Closed)
Patch Set: . Created 3 years, 6 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
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 2372 matching lines...) Expand 10 before | Expand all | Expand 10 after
2383 GURL url = embedded_test_server()->GetURL("bar.com", "/title3.html"); 2383 GURL url = embedded_test_server()->GetURL("bar.com", "/title3.html");
2384 EXPECT_TRUE(embedded_test_server()->ShutdownAndWaitUntilComplete()); 2384 EXPECT_TRUE(embedded_test_server()->ShutdownAndWaitUntilComplete());
2385 NavigateIframeToURL(shell()->web_contents(), "child-0", url); 2385 NavigateIframeToURL(shell()->web_contents(), "child-0", url);
2386 } 2386 }
2387 } 2387 }
2388 2388
2389 namespace { 2389 namespace {
2390 class FailingURLLoaderImpl : public mojom::URLLoader { 2390 class FailingURLLoaderImpl : public mojom::URLLoader {
2391 public: 2391 public:
2392 explicit FailingURLLoaderImpl(mojom::URLLoaderClientPtr client) { 2392 explicit FailingURLLoaderImpl(mojom::URLLoaderClientPtr client) {
2393 Start(mojom::URLLoaderAssociatedRequest(), std::move(client));
2394 }
2395
2396 private:
2397 void Start(mojom::URLLoaderAssociatedRequest request,
2398 mojom::URLLoaderClientPtr client) override {
2393 ResourceRequestCompletionStatus status; 2399 ResourceRequestCompletionStatus status;
2394 status.error_code = net::ERR_NOT_IMPLEMENTED; 2400 status.error_code = net::ERR_NOT_IMPLEMENTED;
2395 client->OnComplete(status); 2401 client->OnComplete(status);
2396 } 2402 }
2397
2398 void FollowRedirect() override {} 2403 void FollowRedirect() override {}
2399 void SetPriority(net::RequestPriority priority, 2404 void SetPriority(net::RequestPriority priority,
2400 int32_t intra_priority_value) override {} 2405 int32_t intra_priority_value) override {}
2401 }; 2406 };
2402 2407
2403 class FailingLoadFactory : public mojom::URLLoaderFactory { 2408 class FailingLoadFactory : public mojom::URLLoaderFactory {
2404 public: 2409 public:
2405 FailingLoadFactory() {} 2410 FailingLoadFactory() {}
2406 ~FailingLoadFactory() override {} 2411 ~FailingLoadFactory() override {}
2407 2412
(...skipping 7783 matching lines...) Expand 10 before | Expand all | Expand 10 after
10191 // Go back again. This should go to foo.com. 10196 // Go back again. This should go to foo.com.
10192 { 10197 {
10193 TestNavigationObserver back_observer(web_contents()); 10198 TestNavigationObserver back_observer(web_contents());
10194 web_contents()->GetController().GoBack(); 10199 web_contents()->GetController().GoBack();
10195 back_observer.Wait(); 10200 back_observer.Wait();
10196 } 10201 }
10197 EXPECT_EQ(foo_url, web_contents()->GetMainFrame()->GetLastCommittedURL()); 10202 EXPECT_EQ(foo_url, web_contents()->GetMainFrame()->GetLastCommittedURL());
10198 } 10203 }
10199 10204
10200 } // namespace content 10205 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698