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

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: Fixed more files Created 8 years, 6 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 (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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 const char* FileWriterDelegateTest::content_ = NULL; 141 const char* FileWriterDelegateTest::content_ = NULL;
142 142
143 namespace { 143 namespace {
144 144
145 static std::string g_content; 145 static std::string g_content;
146 146
147 class FileWriterDelegateTestJob : public net::URLRequestJob { 147 class FileWriterDelegateTestJob : public net::URLRequestJob {
148 public: 148 public:
149 FileWriterDelegateTestJob(net::URLRequest* request, 149 FileWriterDelegateTestJob(net::URLRequest* request,
150 const std::string& content) 150 const std::string& content)
151 : net::URLRequestJob(request), 151 : net::URLRequestJob(request, request->context()->network_delegate()),
152 content_(content), 152 content_(content),
153 remaining_bytes_(content.length()), 153 remaining_bytes_(content.length()),
154 cursor_(0) { 154 cursor_(0) {
155 } 155 }
156 156
157 virtual void Start() OVERRIDE { 157 virtual void Start() OVERRIDE {
158 MessageLoop::current()->PostTask( 158 MessageLoop::current()->PostTask(
159 FROM_HERE, 159 FROM_HERE,
160 base::Bind(&FileWriterDelegateTestJob::NotifyHeadersComplete, this)); 160 base::Bind(&FileWriterDelegateTestJob::NotifyHeadersComplete, this));
161 } 161 }
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 file_writer_delegate_.reset(); 459 file_writer_delegate_.reset();
460 460
461 EXPECT_EQ(pre_write_usage + allowed_growth, 461 EXPECT_EQ(pre_write_usage + allowed_growth,
462 test_helper_.GetCachedOriginUsage()); 462 test_helper_.GetCachedOriginUsage());
463 EXPECT_EQ(ComputeCurrentOriginUsage(), test_helper_.GetCachedOriginUsage()); 463 EXPECT_EQ(ComputeCurrentOriginUsage(), test_helper_.GetCachedOriginUsage());
464 EXPECT_EQ(kOverlap + allowed_growth, result_->bytes_written()); 464 EXPECT_EQ(kOverlap + allowed_growth, result_->bytes_written());
465 EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, result_->status()); 465 EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, result_->status());
466 } 466 }
467 467
468 } // namespace fileapi 468 } // namespace fileapi
OLDNEW
« net/url_request/url_request_job.h ('K') | « 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