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

Side by Side Diff: webkit/browser/blob/blob_url_request_job_unittest.cc

Issue 16155009: Update webkit/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 public net::URLRequestJobFactory::ProtocolHandler { 116 public net::URLRequestJobFactory::ProtocolHandler {
117 public: 117 public:
118 MockProtocolHandler(BlobURLRequestJobTest* test) : test_(test) {} 118 MockProtocolHandler(BlobURLRequestJobTest* test) : test_(test) {}
119 119
120 // net::URLRequestJobFactory::ProtocolHandler override. 120 // net::URLRequestJobFactory::ProtocolHandler override.
121 virtual net::URLRequestJob* MaybeCreateJob( 121 virtual net::URLRequestJob* MaybeCreateJob(
122 net::URLRequest* request, 122 net::URLRequest* request,
123 net::NetworkDelegate* network_delegate) const OVERRIDE { 123 net::NetworkDelegate* network_delegate) const OVERRIDE {
124 return new BlobURLRequestJob(request, 124 return new BlobURLRequestJob(request,
125 network_delegate, 125 network_delegate,
126 test_->blob_data_, 126 test_->blob_data_.get(),
127 test_->file_system_context_, 127 test_->file_system_context_.get(),
128 base::MessageLoopProxy::current()); 128 base::MessageLoopProxy::current());
129 } 129 }
130 130
131 private: 131 private:
132 BlobURLRequestJobTest* test_; 132 BlobURLRequestJobTest* test_;
133 }; 133 };
134 134
135 BlobURLRequestJobTest() 135 BlobURLRequestJobTest()
136 : message_loop_(base::MessageLoop::TYPE_IO), 136 : message_loop_(base::MessageLoop::TYPE_IO),
137 blob_data_(new BlobData()), 137 blob_data_(new BlobData()),
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 base::Time* modification_time) { 200 base::Time* modification_time) {
201 fileapi::FileSystemURL url = 201 fileapi::FileSystemURL url =
202 file_system_context_->CreateCrackedFileSystemURL( 202 file_system_context_->CreateCrackedFileSystemURL(
203 GURL(kFileSystemURLOrigin), 203 GURL(kFileSystemURLOrigin),
204 kFileSystemType, 204 kFileSystemType,
205 base::FilePath().AppendASCII(filename)); 205 base::FilePath().AppendASCII(filename));
206 206
207 fileapi::FileSystemFileUtil* file_util = 207 fileapi::FileSystemFileUtil* file_util =
208 file_system_context_->GetFileUtil(kFileSystemType); 208 file_system_context_->GetFileUtil(kFileSystemType);
209 209
210 fileapi::FileSystemOperationContext context(file_system_context_); 210 fileapi::FileSystemOperationContext context(file_system_context_.get());
211 context.set_allowed_bytes_growth(1024); 211 context.set_allowed_bytes_growth(1024);
212 212
213 base::PlatformFile handle = base::kInvalidPlatformFileValue; 213 base::PlatformFile handle = base::kInvalidPlatformFileValue;
214 bool created = false; 214 bool created = false;
215 ASSERT_EQ(base::PLATFORM_FILE_OK, file_util->CreateOrOpen( 215 ASSERT_EQ(base::PLATFORM_FILE_OK, file_util->CreateOrOpen(
216 &context, 216 &context,
217 url, 217 url,
218 base::PLATFORM_FILE_CREATE | base::PLATFORM_FILE_WRITE, 218 base::PLATFORM_FILE_CREATE | base::PLATFORM_FILE_WRITE,
219 &handle, 219 &handle,
220 &created)); 220 &created));
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 EXPECT_TRUE(request_->response_headers()->GetMimeType(&content_type)); 442 EXPECT_TRUE(request_->response_headers()->GetMimeType(&content_type));
443 EXPECT_EQ(kTestContentType, content_type); 443 EXPECT_EQ(kTestContentType, content_type);
444 void* iter = NULL; 444 void* iter = NULL;
445 std::string content_disposition; 445 std::string content_disposition;
446 EXPECT_TRUE(request_->response_headers()->EnumerateHeader( 446 EXPECT_TRUE(request_->response_headers()->EnumerateHeader(
447 &iter, "Content-Disposition", &content_disposition)); 447 &iter, "Content-Disposition", &content_disposition));
448 EXPECT_EQ(kTestContentDisposition, content_disposition); 448 EXPECT_EQ(kTestContentDisposition, content_disposition);
449 } 449 }
450 450
451 } // namespace webkit_blob 451 } // namespace webkit_blob
OLDNEW
« no previous file with comments | « webkit/browser/blob/blob_url_request_job_factory.cc ('k') | webkit/browser/blob/local_file_stream_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698