| 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 return new FileWriterDelegateTestJob( | 215 return new FileWriterDelegateTestJob( |
| 216 request, FileWriterDelegateTest::content_); | 216 request, FileWriterDelegateTest::content_); |
| 217 } | 217 } |
| 218 | 218 |
| 219 void FileWriterDelegateTest::SetUp() { | 219 void FileWriterDelegateTest::SetUp() { |
| 220 ASSERT_TRUE(dir_.CreateUniqueTempDir()); | 220 ASSERT_TRUE(dir_.CreateUniqueTempDir()); |
| 221 FilePath base_dir = dir_.path().AppendASCII("filesystem"); | 221 FilePath base_dir = dir_.path().AppendASCII("filesystem"); |
| 222 SetUpTestHelper(base_dir); | 222 SetUpTestHelper(base_dir); |
| 223 ASSERT_TRUE(file_util::CreateTemporaryFileInDir( | 223 ASSERT_TRUE(file_util::CreateTemporaryFileInDir( |
| 224 test_helper_.GetOriginRootPath(), &file_path_)); | 224 test_helper_.GetOriginRootPath(), &file_path_)); |
| 225 net::URLRequest::RegisterProtocolFactory("blob", &Factory); | 225 net::URLRequest::Deprecated::RegisterProtocolFactory("blob", &Factory); |
| 226 } | 226 } |
| 227 | 227 |
| 228 void FileWriterDelegateTest::TearDown() { | 228 void FileWriterDelegateTest::TearDown() { |
| 229 net::URLRequest::RegisterProtocolFactory("blob", NULL); | 229 net::URLRequest::Deprecated::RegisterProtocolFactory("blob", NULL); |
| 230 base::ClosePlatformFile(file_); | 230 base::ClosePlatformFile(file_); |
| 231 test_helper_.TearDown(); | 231 test_helper_.TearDown(); |
| 232 } | 232 } |
| 233 | 233 |
| 234 FileSystemOperation* FileWriterDelegateTest::CreateNewOperation( | 234 FileSystemOperation* FileWriterDelegateTest::CreateNewOperation( |
| 235 Result* result, int64 quota) { | 235 Result* result, int64 quota) { |
| 236 FileSystemOperation* operation = test_helper_.NewOperation( | 236 FileSystemOperation* operation = test_helper_.NewOperation( |
| 237 new MockDispatcher(result)); | 237 new MockDispatcher(result)); |
| 238 FileSystemOperationContext* context = | 238 FileSystemOperationContext* context = |
| 239 operation->file_system_operation_context(); | 239 operation->file_system_operation_context(); |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 EXPECT_EQ(kDataSize + FileSystemUsageCache::kUsageFileSize, | 501 EXPECT_EQ(kDataSize + FileSystemUsageCache::kUsageFileSize, |
| 502 test_helper_.GetCachedOriginUsage()); | 502 test_helper_.GetCachedOriginUsage()); |
| 503 EXPECT_EQ(ComputeCurrentOriginUsage() + FileSystemUsageCache::kUsageFileSize, | 503 EXPECT_EQ(ComputeCurrentOriginUsage() + FileSystemUsageCache::kUsageFileSize, |
| 504 test_helper_.GetCachedOriginUsage()); | 504 test_helper_.GetCachedOriginUsage()); |
| 505 EXPECT_EQ(kDataSize, result_->bytes_written()); | 505 EXPECT_EQ(kDataSize, result_->bytes_written()); |
| 506 EXPECT_EQ(base::PLATFORM_FILE_OK, result_->status()); | 506 EXPECT_EQ(base::PLATFORM_FILE_OK, result_->status()); |
| 507 EXPECT_TRUE(result_->complete()); | 507 EXPECT_TRUE(result_->complete()); |
| 508 } | 508 } |
| 509 | 509 |
| 510 } // namespace fileapi | 510 } // namespace fileapi |
| OLD | NEW |