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

Side by Side Diff: chrome/browser/devtools/devtools_network_controller_unittest.cc

Issue 2227503003: Add net log to UploadDataStream. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typo Created 4 years, 4 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 | « no previous file | chrome/browser/devtools/devtools_network_upload_data_stream.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/devtools/devtools_network_controller.h" 5 #include "chrome/browser/devtools/devtools_network_controller.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 119
120 bool HasFailed() { 120 bool HasFailed() {
121 return transaction_->failed_; 121 return transaction_->failed_;
122 } 122 }
123 123
124 void CancelTransaction() { 124 void CancelTransaction() {
125 transaction_.reset(); 125 transaction_.reset();
126 } 126 }
127 127
128 int ReadUploadData() { 128 int ReadUploadData() {
129 EXPECT_EQ(net::OK, 129 EXPECT_EQ(net::OK, transaction_->custom_upload_data_stream_->Init(
130 transaction_->custom_upload_data_stream_->Init(completion_callback_)); 130 completion_callback_, net::BoundNetLog()));
131 return transaction_->custom_upload_data_stream_->Read( 131 return transaction_->custom_upload_data_stream_->Read(
132 buffer_.get(), 64, completion_callback_); 132 buffer_.get(), 64, completion_callback_);
133 } 133 }
134 134
135 ~DevToolsNetworkControllerHelper() { 135 ~DevToolsNetworkControllerHelper() {
136 RemoveMockTransaction(&mock_transaction_); 136 RemoveMockTransaction(&mock_transaction_);
137 } 137 }
138 138
139 TestCallback* callback() { return &callback_; } 139 TestCallback* callback() { return &callback_; }
140 DevToolsNetworkController* controller() { return &controller_; } 140 DevToolsNetworkController* controller() { return &controller_; }
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 319
320 rv = helper.ReadUploadData(); 320 rv = helper.ReadUploadData();
321 EXPECT_EQ(rv, net::ERR_IO_PENDING); 321 EXPECT_EQ(rv, net::ERR_IO_PENDING);
322 EXPECT_EQ(callback->run_count(), 1); 322 EXPECT_EQ(callback->run_count(), 1);
323 base::RunLoop().RunUntilIdle(); 323 base::RunLoop().RunUntilIdle();
324 EXPECT_EQ(callback->run_count(), 2); 324 EXPECT_EQ(callback->run_count(), 2);
325 EXPECT_EQ(callback->value(), static_cast<int>(arraysize(kUploadData))); 325 EXPECT_EQ(callback->value(), static_cast<int>(arraysize(kUploadData)));
326 } 326 }
327 327
328 } // namespace test 328 } // namespace test
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/devtools/devtools_network_upload_data_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698