| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 61   int64 usage_; | 61   int64 usage_; | 
| 62   int64 quota_; | 62   int64 quota_; | 
| 63 }; | 63 }; | 
| 64 | 64 | 
| 65 }  // namespace (anonymous) | 65 }  // namespace (anonymous) | 
| 66 | 66 | 
| 67 class FileSystemOperationWriteTest : public testing::Test { | 67 class FileSystemOperationWriteTest : public testing::Test { | 
| 68  public: | 68  public: | 
| 69   FileSystemOperationWriteTest() | 69   FileSystemOperationWriteTest() | 
| 70       : local_file_util_( | 70       : local_file_util_( | 
| 71             new LocalFileSystemFileUtil(QuotaFileUtil::GetInstance())), | 71             new LocalFileSystemFileUtil(QuotaFileUtil::CreateDefault())), | 
| 72         loop_(MessageLoop::TYPE_IO), | 72         loop_(MessageLoop::TYPE_IO), | 
| 73         status_(base::PLATFORM_FILE_OK), | 73         status_(base::PLATFORM_FILE_OK), | 
| 74         bytes_written_(0), | 74         bytes_written_(0), | 
| 75         complete_(false) {} | 75         complete_(false) {} | 
| 76 | 76 | 
| 77   FileSystemOperation* operation(); | 77   FileSystemOperation* operation(); | 
| 78 | 78 | 
| 79   void set_failure_status(base::PlatformFileError status) { | 79   void set_failure_status(base::PlatformFileError status) { | 
| 80     EXPECT_FALSE(complete_); | 80     EXPECT_FALSE(complete_); | 
| 81     EXPECT_EQ(status_, base::PLATFORM_FILE_OK); | 81     EXPECT_EQ(status_, base::PLATFORM_FILE_OK); | 
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 339   url_request_context->blob_storage_controller()->UnregisterBlobUrl(blob_url); | 339   url_request_context->blob_storage_controller()->UnregisterBlobUrl(blob_url); | 
| 340 | 340 | 
| 341   EXPECT_EQ(10, bytes_written()); | 341   EXPECT_EQ(10, bytes_written()); | 
| 342   EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, status()); | 342   EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, status()); | 
| 343   EXPECT_TRUE(complete()); | 343   EXPECT_TRUE(complete()); | 
| 344 } | 344 } | 
| 345 | 345 | 
| 346 // TODO(ericu,dmikurube): Add tests for Cancel. | 346 // TODO(ericu,dmikurube): Add tests for Cancel. | 
| 347 | 347 | 
| 348 }  // namespace fileapi | 348 }  // namespace fileapi | 
| OLD | NEW | 
|---|