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

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: 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(
101 const net::RedirectInfo& redirect_info, 101 const net::RedirectInfo& redirect_info,
102 const scoped_refptr<ResourceResponse>& response) override { 102 const scoped_refptr<ResourceResponse>& response,
103 bool is_external_protocol) override {
103 redirect_info_ = redirect_info; 104 redirect_info_ = redirect_info;
104 redirect_response_ = response; 105 redirect_response_ = response;
105 ASSERT_TRUE(request_redirected_); 106 ASSERT_TRUE(request_redirected_);
106 request_redirected_->Quit(); 107 request_redirected_->Quit();
107 } 108 }
108 109
109 void OnResponseStarted(const scoped_refptr<ResourceResponse>& response, 110 void OnResponseStarted(const scoped_refptr<ResourceResponse>& response,
110 scoped_ptr<StreamHandle> body) override { 111 scoped_ptr<StreamHandle> body) override {
111 response_ = response; 112 response_ = response;
112 body_ = body.Pass(); 113 body_ = body.Pass();
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 394
394 // Release the body. 395 // Release the body.
395 delegate.ReleaseBody(); 396 delegate.ReleaseBody();
396 base::RunLoop().RunUntilIdle(); 397 base::RunLoop().RunUntilIdle();
397 398
398 // Verify that URLRequestTestJob no longer has anything paused. 399 // Verify that URLRequestTestJob no longer has anything paused.
399 EXPECT_FALSE(net::URLRequestTestJob::ProcessOnePendingMessage()); 400 EXPECT_FALSE(net::URLRequestTestJob::ProcessOnePendingMessage());
400 } 401 }
401 402
402 } // namespace content 403 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698