| OLD | NEW |
| 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 set_job_factory(&job_factory_); | 183 set_job_factory(&job_factory_); |
| 184 } | 184 } |
| 185 | 185 |
| 186 virtual ~TestURLRequestContext() {} | 186 virtual ~TestURLRequestContext() {} |
| 187 | 187 |
| 188 webkit_blob::BlobStorageController* blob_storage_controller() const { | 188 webkit_blob::BlobStorageController* blob_storage_controller() const { |
| 189 return blob_storage_controller_.get(); | 189 return blob_storage_controller_.get(); |
| 190 } | 190 } |
| 191 | 191 |
| 192 private: | 192 private: |
| 193 net::URLRequestJobFactory job_factory_; | 193 net::URLRequestJobFactoryImpl job_factory_; |
| 194 scoped_ptr<webkit_blob::BlobStorageController> blob_storage_controller_; | 194 scoped_ptr<webkit_blob::BlobStorageController> blob_storage_controller_; |
| 195 | 195 |
| 196 DISALLOW_COPY_AND_ASSIGN(TestURLRequestContext); | 196 DISALLOW_COPY_AND_ASSIGN(TestURLRequestContext); |
| 197 }; | 197 }; |
| 198 | 198 |
| 199 } // namespace (anonymous) | 199 } // namespace (anonymous) |
| 200 | 200 |
| 201 void LocalFileSystemOperationWriteTest::SetUp() { | 201 void LocalFileSystemOperationWriteTest::SetUp() { |
| 202 ASSERT_TRUE(dir_.CreateUniqueTempDir()); | 202 ASSERT_TRUE(dir_.CreateUniqueTempDir()); |
| 203 FilePath base_dir = dir_.path().AppendASCII("filesystem"); | 203 FilePath base_dir = dir_.path().AppendASCII("filesystem"); |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 // so nothing should have happen. | 399 // so nothing should have happen. |
| 400 EXPECT_EQ(0, bytes_written()); | 400 EXPECT_EQ(0, bytes_written()); |
| 401 EXPECT_EQ(base::PLATFORM_FILE_ERROR_ABORT, status()); | 401 EXPECT_EQ(base::PLATFORM_FILE_ERROR_ABORT, status()); |
| 402 EXPECT_EQ(base::PLATFORM_FILE_OK, cancel_status()); | 402 EXPECT_EQ(base::PLATFORM_FILE_OK, cancel_status()); |
| 403 EXPECT_TRUE(complete()); | 403 EXPECT_TRUE(complete()); |
| 404 } | 404 } |
| 405 | 405 |
| 406 // TODO(ericu,dmikurube,kinuko): Add more tests for cancel cases. | 406 // TODO(ericu,dmikurube,kinuko): Add more tests for cancel cases. |
| 407 | 407 |
| 408 } // namespace fileapi | 408 } // namespace fileapi |
| OLD | NEW |