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

Side by Side Diff: net/url_request/url_request_file_dir_job_unittest.cc

Issue 2262653003: Make URLRequest::Read to return net errors or bytes read instead of a bool (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 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 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 "net/url_request/url_request_file_dir_job.h" 5 #include "net/url_request/url_request_file_dir_job.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 DISALLOW_COPY_AND_ASSIGN(TestJobFactory); 76 DISALLOW_COPY_AND_ASSIGN(TestJobFactory);
77 }; 77 };
78 78
79 class TestDirectoryURLRequestDelegate : public TestDelegate { 79 class TestDirectoryURLRequestDelegate : public TestDelegate {
80 public: 80 public:
81 TestDirectoryURLRequestDelegate() {} 81 TestDirectoryURLRequestDelegate() {}
82 82
83 ~TestDirectoryURLRequestDelegate() override {} 83 ~TestDirectoryURLRequestDelegate() override {}
84 84
85 void OnResponseStarted(URLRequest* request) override { 85 void OnResponseStarted(URLRequest* request, int net_error) override {
86 got_response_started_ = true; 86 got_response_started_ = true;
87 } 87 }
88 88
89 bool got_response_started() const { return got_response_started_; } 89 bool got_response_started() const { return got_response_started_; }
90 90
91 private: 91 private:
92 bool got_response_started_ = false; 92 bool got_response_started_ = false;
93 93
94 DISALLOW_COPY_AND_ASSIGN(TestDirectoryURLRequestDelegate); 94 DISALLOW_COPY_AND_ASSIGN(TestDirectoryURLRequestDelegate);
95 }; 95 };
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 ASSERT_GT(delegate.bytes_received(), 0); 248 ASSERT_GT(delegate.bytes_received(), 0);
249 ASSERT_LE(delegate.bytes_received(), kBufferSize); 249 ASSERT_LE(delegate.bytes_received(), kBufferSize);
250 EXPECT_TRUE(delegate.data_received().find( 250 EXPECT_TRUE(delegate.data_received().find(
251 directory.path().BaseName().MaybeAsASCII()) != 251 directory.path().BaseName().MaybeAsASCII()) !=
252 std::string::npos); 252 std::string::npos);
253 } 253 }
254 254
255 } // namespace 255 } // namespace
256 256
257 } // namespace net 257 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698