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

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

Issue 10836248: Turned job_factory into a pure virtual class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Latest merge Created 8 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 | 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 <vector> 5 #include <vector>
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/message_loop_proxy.h" 10 #include "base/message_loop_proxy.h"
11 #include "base/scoped_temp_dir.h" 11 #include "base/scoped_temp_dir.h"
12 #include "googleurl/src/gurl.h" 12 #include "googleurl/src/gurl.h"
13 #include "net/url_request/url_request.h" 13 #include "net/url_request/url_request.h"
14 #include "net/url_request/url_request_context.h" 14 #include "net/url_request/url_request_context.h"
15 #include "net/url_request/url_request_job.h" 15 #include "net/url_request/url_request_job.h"
16 #include "net/url_request/url_request_job_factory.h" 16 #include "net/url_request/url_request_job_factory_impl.h"
17 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
18 #include "webkit/blob/blob_data.h" 18 #include "webkit/blob/blob_data.h"
19 #include "webkit/blob/blob_storage_controller.h" 19 #include "webkit/blob/blob_storage_controller.h"
20 #include "webkit/blob/blob_url_request_job.h" 20 #include "webkit/blob/blob_url_request_job.h"
21 #include "webkit/fileapi/file_system_context.h" 21 #include "webkit/fileapi/file_system_context.h"
22 #include "webkit/fileapi/file_system_file_util.h" 22 #include "webkit/fileapi/file_system_file_util.h"
23 #include "webkit/fileapi/file_system_util.h" 23 #include "webkit/fileapi/file_system_util.h"
24 #include "webkit/fileapi/local_file_system_operation.h" 24 #include "webkit/fileapi/local_file_system_operation.h"
25 #include "webkit/fileapi/local_file_system_test_helper.h" 25 #include "webkit/fileapi/local_file_system_test_helper.h"
26 #include "webkit/fileapi/local_file_util.h" 26 #include "webkit/fileapi/local_file_util.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 set_job_factory(&job_factory_); 185 set_job_factory(&job_factory_);
186 } 186 }
187 187
188 virtual ~TestURLRequestContext() {} 188 virtual ~TestURLRequestContext() {}
189 189
190 webkit_blob::BlobStorageController* blob_storage_controller() const { 190 webkit_blob::BlobStorageController* blob_storage_controller() const {
191 return blob_storage_controller_.get(); 191 return blob_storage_controller_.get();
192 } 192 }
193 193
194 private: 194 private:
195 net::URLRequestJobFactory job_factory_; 195 net::URLRequestJobFactoryImpl job_factory_;
196 scoped_ptr<webkit_blob::BlobStorageController> blob_storage_controller_; 196 scoped_ptr<webkit_blob::BlobStorageController> blob_storage_controller_;
197 197
198 DISALLOW_COPY_AND_ASSIGN(TestURLRequestContext); 198 DISALLOW_COPY_AND_ASSIGN(TestURLRequestContext);
199 }; 199 };
200 200
201 } // namespace (anonymous) 201 } // namespace (anonymous)
202 202
203 void LocalFileSystemOperationWriteTest::SetUp() { 203 void LocalFileSystemOperationWriteTest::SetUp() {
204 ASSERT_TRUE(dir_.CreateUniqueTempDir()); 204 ASSERT_TRUE(dir_.CreateUniqueTempDir());
205 FilePath base_dir = dir_.path().AppendASCII("filesystem"); 205 FilePath base_dir = dir_.path().AppendASCII("filesystem");
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 // so nothing should have happen. 401 // so nothing should have happen.
402 EXPECT_EQ(0, bytes_written()); 402 EXPECT_EQ(0, bytes_written());
403 EXPECT_EQ(base::PLATFORM_FILE_ERROR_ABORT, status()); 403 EXPECT_EQ(base::PLATFORM_FILE_ERROR_ABORT, status());
404 EXPECT_EQ(base::PLATFORM_FILE_OK, cancel_status()); 404 EXPECT_EQ(base::PLATFORM_FILE_OK, cancel_status());
405 EXPECT_TRUE(complete()); 405 EXPECT_TRUE(complete());
406 } 406 }
407 407
408 // TODO(ericu,dmikurube,kinuko): Add more tests for cancel cases. 408 // TODO(ericu,dmikurube,kinuko): Add more tests for cancel cases.
409 409
410 } // namespace fileapi 410 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/appcache/appcache_update_job_unittest.cc ('k') | webkit/tools/test_shell/test_shell_request_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698