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

Side by Side Diff: content/test/test_navigation_url_loader_delegate.cc

Issue 2537593002: PlzNavigate: Pass move information along with the response started notification for navigation requ… (Closed)
Patch Set: . Created 4 years 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/test/test_navigation_url_loader_delegate.h ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/test/test_navigation_url_loader_delegate.h" 5 #include "content/test/test_navigation_url_loader_delegate.h"
6 6
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "content/public/browser/global_request_id.h"
8 #include "content/public/browser/navigation_data.h" 9 #include "content/public/browser/navigation_data.h"
9 #include "content/public/browser/stream_handle.h" 10 #include "content/public/browser/stream_handle.h"
10 #include "content/public/common/resource_response.h" 11 #include "content/public/common/resource_response.h"
11 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
12 13
13 namespace content { 14 namespace content {
14 15
15 TestNavigationURLLoaderDelegate::TestNavigationURLLoaderDelegate() 16 TestNavigationURLLoaderDelegate::TestNavigationURLLoaderDelegate()
16 : net_error_(0), on_request_handled_counter_(0) {} 17 : net_error_(0), on_request_handled_counter_(0) {}
17 18
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 redirect_info_ = redirect_info; 52 redirect_info_ = redirect_info;
52 redirect_response_ = response; 53 redirect_response_ = response;
53 ASSERT_TRUE(request_redirected_); 54 ASSERT_TRUE(request_redirected_);
54 request_redirected_->Quit(); 55 request_redirected_->Quit();
55 } 56 }
56 57
57 void TestNavigationURLLoaderDelegate::OnResponseStarted( 58 void TestNavigationURLLoaderDelegate::OnResponseStarted(
58 const scoped_refptr<ResourceResponse>& response, 59 const scoped_refptr<ResourceResponse>& response,
59 std::unique_ptr<StreamHandle> body, 60 std::unique_ptr<StreamHandle> body,
60 const SSLStatus& ssl_status, 61 const SSLStatus& ssl_status,
61 std::unique_ptr<NavigationData> navigation_data) { 62 std::unique_ptr<NavigationData> navigation_data,
63 const GlobalRequestID& request_id,
64 bool is_download,
65 bool is_stream) {
62 response_ = response; 66 response_ = response;
63 body_ = std::move(body); 67 body_ = std::move(body);
64 ASSERT_TRUE(response_started_); 68 ASSERT_TRUE(response_started_);
65 response_started_->Quit(); 69 response_started_->Quit();
66 } 70 }
67 71
68 void TestNavigationURLLoaderDelegate::OnRequestFailed(bool in_cache, 72 void TestNavigationURLLoaderDelegate::OnRequestFailed(bool in_cache,
69 int net_error) { 73 int net_error) {
70 net_error_ = net_error; 74 net_error_ = net_error;
71 if (request_failed_) 75 if (request_failed_)
72 request_failed_->Quit(); 76 request_failed_->Quit();
73 } 77 }
74 78
75 void TestNavigationURLLoaderDelegate::OnRequestStarted( 79 void TestNavigationURLLoaderDelegate::OnRequestStarted(
76 base::TimeTicks timestamp) { 80 base::TimeTicks timestamp) {
77 ASSERT_FALSE(timestamp.is_null()); 81 ASSERT_FALSE(timestamp.is_null());
78 ++on_request_handled_counter_; 82 ++on_request_handled_counter_;
79 if (request_started_) 83 if (request_started_)
80 request_started_->Quit(); 84 request_started_->Quit();
81 } 85 }
82 86
83 } // namespace content 87 } // namespace content
OLDNEW
« no previous file with comments | « content/test/test_navigation_url_loader_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698