| 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 // This test checks the entire behavior of FileSystem usage and quota, such as: | 5 // This test checks the entire behavior of FileSystem usage and quota, such as: |
| 6 // 1) the actual size of files on disk, | 6 // 1) the actual size of files on disk, |
| 7 // 2) the described size in .usage, and | 7 // 2) the described size in .usage, and |
| 8 // 3) the result of QuotaManager::GetUsageAndQuota. | 8 // 3) the result of QuotaManager::GetUsageAndQuota. |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 work_dir_.path().AppendASCII("filesystem"); | 56 work_dir_.path().AppendASCII("filesystem"); |
| 57 ASSERT_TRUE(file_util::CreateDirectory(filesystem_dir_path)); | 57 ASSERT_TRUE(file_util::CreateDirectory(filesystem_dir_path)); |
| 58 | 58 |
| 59 quota_manager_ = new quota::QuotaManager( | 59 quota_manager_ = new quota::QuotaManager( |
| 60 false /* is_incognito */, | 60 false /* is_incognito */, |
| 61 filesystem_dir_path, | 61 filesystem_dir_path, |
| 62 base::MessageLoopProxy::current(), | 62 base::MessageLoopProxy::current(), |
| 63 base::MessageLoopProxy::current(), | 63 base::MessageLoopProxy::current(), |
| 64 NULL); | 64 NULL); |
| 65 | 65 |
| 66 test_helper_.SetUp(filesystem_dir_path, | 66 test_helper_.SetUp(filesystem_dir_path, quota_manager_->proxy()); |
| 67 false /* unlimited quota */, | |
| 68 quota_manager_->proxy()); | |
| 69 } | 67 } |
| 70 | 68 |
| 71 virtual void TearDown() OVERRIDE { | 69 virtual void TearDown() OVERRIDE { |
| 72 quota_manager_ = NULL; | 70 quota_manager_ = NULL; |
| 73 test_helper_.TearDown(); | 71 test_helper_.TearDown(); |
| 74 } | 72 } |
| 75 | 73 |
| 76 LocalFileSystemOperation* NewOperation() { | 74 LocalFileSystemOperation* NewOperation() { |
| 77 return test_helper_.NewOperation(); | 75 return test_helper_.NewOperation(); |
| 78 } | 76 } |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 | 338 |
| 341 EXPECT_EQ(2 * child_file_size + 3 * grandchild_file_size, ActualFileSize()); | 339 EXPECT_EQ(2 * child_file_size + 3 * grandchild_file_size, ActualFileSize()); |
| 342 EXPECT_EQ(expected_usage, SizeByQuotaUtil()); | 340 EXPECT_EQ(expected_usage, SizeByQuotaUtil()); |
| 343 GetUsageAndQuotaFromQuotaManager(); | 341 GetUsageAndQuotaFromQuotaManager(); |
| 344 EXPECT_EQ(quota::kQuotaStatusOk, quota_status()); | 342 EXPECT_EQ(quota::kQuotaStatusOk, quota_status()); |
| 345 EXPECT_EQ(expected_usage, usage()); | 343 EXPECT_EQ(expected_usage, usage()); |
| 346 ASSERT_LT(expected_usage, quota()); | 344 ASSERT_LT(expected_usage, quota()); |
| 347 } | 345 } |
| 348 | 346 |
| 349 } // namespace fileapi | 347 } // namespace fileapi |
| OLD | NEW |