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

Side by Side Diff: content/browser/loader/navigation_url_loader_unittest.cc

Issue 1269813002: Add a NavigationThrottle to the public content/ interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@navigation-api
Patch Set: Addressed comments Created 5 years, 3 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 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/macros.h" 6 #include "base/macros.h"
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "content/browser/frame_host/navigation_request_info.h" 10 #include "content/browser/frame_host/navigation_request_info.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 request_failed_.reset(new base::RunLoop); 90 request_failed_.reset(new base::RunLoop);
91 request_failed_->Run(); 91 request_failed_->Run();
92 request_failed_.reset(); 92 request_failed_.reset();
93 } 93 }
94 94
95 void ReleaseBody() { 95 void ReleaseBody() {
96 body_.reset(); 96 body_.reset();
97 } 97 }
98 98
99 // NavigationURLLoaderDelegate implementation. 99 // NavigationURLLoaderDelegate implementation.
100 void OnRequestRedirected( 100 void OnRequestRedirected(const net::RedirectInfo& redirect_info,
101 const net::RedirectInfo& redirect_info, 101 const scoped_refptr<ResourceResponse>& response,
102 const scoped_refptr<ResourceResponse>& response) override { 102 bool is_external_protocol) override {
103 redirect_info_ = redirect_info; 103 redirect_info_ = redirect_info;
104 redirect_response_ = response; 104 redirect_response_ = response;
105 ASSERT_TRUE(request_redirected_); 105 ASSERT_TRUE(request_redirected_);
106 request_redirected_->Quit(); 106 request_redirected_->Quit();
107 } 107 }
108 108
109 void OnResponseStarted(const scoped_refptr<ResourceResponse>& response, 109 void OnResponseStarted(const scoped_refptr<ResourceResponse>& response,
110 scoped_ptr<StreamHandle> body) override { 110 scoped_ptr<StreamHandle> body) override {
111 response_ = response; 111 response_ = response;
112 body_ = body.Pass(); 112 body_ = body.Pass();
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 393
394 // Release the body. 394 // Release the body.
395 delegate.ReleaseBody(); 395 delegate.ReleaseBody();
396 base::RunLoop().RunUntilIdle(); 396 base::RunLoop().RunUntilIdle();
397 397
398 // Verify that URLRequestTestJob no longer has anything paused. 398 // Verify that URLRequestTestJob no longer has anything paused.
399 EXPECT_FALSE(net::URLRequestTestJob::ProcessOnePendingMessage()); 399 EXPECT_FALSE(net::URLRequestTestJob::ProcessOnePendingMessage());
400 } 400 }
401 401
402 } // namespace content 402 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698