| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // NOTE: These tests are run as part of "unit_tests" (in chrome/test/unit) | 5 // NOTE: These tests are run as part of "unit_tests" (in chrome/test/unit) |
| 6 // rather than as part of test_shell_tests because they rely on being able | 6 // rather than as part of test_shell_tests because they rely on being able |
| 7 // to instantiate a MessageLoop of type TYPE_IO. test_shell_tests uses | 7 // to instantiate a MessageLoop of type TYPE_IO. test_shell_tests uses |
| 8 // TYPE_UI, which URLRequest doesn't allow. | 8 // TYPE_UI, which URLRequest doesn't allow. |
| 9 // | 9 // |
| 10 | 10 |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 test_helper_.SetUp(base_dir, | 196 test_helper_.SetUp(base_dir, |
| 197 false /* incognito */, | 197 false /* incognito */, |
| 198 false /* unlimited quota */, | 198 false /* unlimited quota */, |
| 199 quota_manager_->proxy(), | 199 quota_manager_->proxy(), |
| 200 local_file_util_.get()); | 200 local_file_util_.get()); |
| 201 filesystem_dir_ = test_helper_.GetOriginRootPath(); | 201 filesystem_dir_ = test_helper_.GetOriginRootPath(); |
| 202 | 202 |
| 203 ASSERT_TRUE(file_util::CreateTemporaryFileInDir(filesystem_dir_, &file_)); | 203 ASSERT_TRUE(file_util::CreateTemporaryFileInDir(filesystem_dir_, &file_)); |
| 204 virtual_path_ = file_.BaseName(); | 204 virtual_path_ = file_.BaseName(); |
| 205 | 205 |
| 206 net::URLRequest::RegisterProtocolFactory("blob", &BlobURLRequestJobFactory); | 206 net::URLRequest::Deprecated::RegisterProtocolFactory( |
| 207 "blob", &BlobURLRequestJobFactory); |
| 207 } | 208 } |
| 208 | 209 |
| 209 void FileSystemOperationWriteTest::TearDown() { | 210 void FileSystemOperationWriteTest::TearDown() { |
| 210 net::URLRequest::RegisterProtocolFactory("blob", NULL); | 211 net::URLRequest::Deprecated::RegisterProtocolFactory("blob", NULL); |
| 211 quota_manager_ = NULL; | 212 quota_manager_ = NULL; |
| 212 test_helper_.TearDown(); | 213 test_helper_.TearDown(); |
| 213 } | 214 } |
| 214 | 215 |
| 215 FileSystemOperation* FileSystemOperationWriteTest::operation() { | 216 FileSystemOperation* FileSystemOperationWriteTest::operation() { |
| 216 return test_helper_.NewOperation(new MockDispatcher(this)); | 217 return test_helper_.NewOperation(new MockDispatcher(this)); |
| 217 } | 218 } |
| 218 | 219 |
| 219 TEST_F(FileSystemOperationWriteTest, TestWriteSuccess) { | 220 TEST_F(FileSystemOperationWriteTest, TestWriteSuccess) { |
| 220 GURL blob_url("blob:success"); | 221 GURL blob_url("blob:success"); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 url_request_context->blob_storage_controller()->UnregisterBlobUrl(blob_url); | 339 url_request_context->blob_storage_controller()->UnregisterBlobUrl(blob_url); |
| 339 | 340 |
| 340 EXPECT_EQ(10, bytes_written()); | 341 EXPECT_EQ(10, bytes_written()); |
| 341 EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, status()); | 342 EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, status()); |
| 342 EXPECT_TRUE(complete()); | 343 EXPECT_TRUE(complete()); |
| 343 } | 344 } |
| 344 | 345 |
| 345 // TODO(ericu,dmikurube): Add tests for Cancel. | 346 // TODO(ericu,dmikurube): Add tests for Cancel. |
| 346 | 347 |
| 347 } // namespace fileapi | 348 } // namespace fileapi |
| OLD | NEW |