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

Side by Side Diff: webkit/fileapi/file_writer_delegate_unittest.cc

Issue 10534100: Decouple URLRequestJob from URLRequestContext; access NetworkDelegate as a contructor parameter. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merged with latest sync Created 8 years, 5 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 | « webkit/fileapi/file_system_url_request_job.cc ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 const char* FileWriterDelegateTest::content_ = NULL; 137 const char* FileWriterDelegateTest::content_ = NULL;
138 138
139 namespace { 139 namespace {
140 140
141 static std::string g_content; 141 static std::string g_content;
142 142
143 class FileWriterDelegateTestJob : public net::URLRequestJob { 143 class FileWriterDelegateTestJob : public net::URLRequestJob {
144 public: 144 public:
145 FileWriterDelegateTestJob(net::URLRequest* request, 145 FileWriterDelegateTestJob(net::URLRequest* request,
146 const std::string& content) 146 const std::string& content)
147 : net::URLRequestJob(request), 147 : net::URLRequestJob(request, request->context()->network_delegate()),
148 content_(content), 148 content_(content),
149 remaining_bytes_(content.length()), 149 remaining_bytes_(content.length()),
150 cursor_(0) { 150 cursor_(0) {
151 } 151 }
152 152
153 virtual void Start() OVERRIDE { 153 virtual void Start() OVERRIDE {
154 MessageLoop::current()->PostTask( 154 MessageLoop::current()->PostTask(
155 FROM_HERE, 155 FROM_HERE,
156 base::Bind(&FileWriterDelegateTestJob::NotifyHeadersComplete, this)); 156 base::Bind(&FileWriterDelegateTestJob::NotifyHeadersComplete, this));
157 } 157 }
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 file_writer_delegate_.reset(); 455 file_writer_delegate_.reset();
456 456
457 EXPECT_EQ(pre_write_usage + allowed_growth, 457 EXPECT_EQ(pre_write_usage + allowed_growth,
458 test_helper_.GetCachedOriginUsage()); 458 test_helper_.GetCachedOriginUsage());
459 EXPECT_EQ(ComputeCurrentOriginUsage(), test_helper_.GetCachedOriginUsage()); 459 EXPECT_EQ(ComputeCurrentOriginUsage(), test_helper_.GetCachedOriginUsage());
460 EXPECT_EQ(kOverlap + allowed_growth, result_->bytes_written()); 460 EXPECT_EQ(kOverlap + allowed_growth, result_->bytes_written());
461 EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, result_->status()); 461 EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, result_->status());
462 } 462 }
463 463
464 } // namespace fileapi 464 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_url_request_job.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698