| 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 // 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 file_util::CreateDirectory(filesystem_dir_path); | 196 file_util::CreateDirectory(filesystem_dir_path); |
| 197 | 197 |
| 198 quota_manager_ = new quota::QuotaManager( | 198 quota_manager_ = new quota::QuotaManager( |
| 199 false /* is_incognito */, | 199 false /* is_incognito */, |
| 200 filesystem_dir_path, | 200 filesystem_dir_path, |
| 201 base::MessageLoopProxy::current(), | 201 base::MessageLoopProxy::current(), |
| 202 base::MessageLoopProxy::current(), | 202 base::MessageLoopProxy::current(), |
| 203 NULL); | 203 NULL); |
| 204 | 204 |
| 205 test_helper_.SetUp(filesystem_dir_path, | 205 test_helper_.SetUp(filesystem_dir_path, |
| 206 false /* incognito */, | |
| 207 false /* unlimited quota */, | 206 false /* unlimited quota */, |
| 208 quota_manager_->proxy(), | 207 quota_manager_->proxy(), |
| 209 local_file_util_.get()); | 208 local_file_util_.get()); |
| 210 } | 209 } |
| 211 | 210 |
| 212 void FileSystemQuotaTest::TearDown() { | 211 void FileSystemQuotaTest::TearDown() { |
| 213 quota_manager_ = NULL; | 212 quota_manager_ = NULL; |
| 214 test_helper_.TearDown(); | 213 test_helper_.TearDown(); |
| 215 } | 214 } |
| 216 | 215 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 | 327 |
| 329 EXPECT_EQ(2 * child_file_size + 3 * grandchild_file_size, ActualSize()); | 328 EXPECT_EQ(2 * child_file_size + 3 * grandchild_file_size, ActualSize()); |
| 330 EXPECT_EQ(2 * child_file_size + 3 * grandchild_file_size, SizeInUsageFile()); | 329 EXPECT_EQ(2 * child_file_size + 3 * grandchild_file_size, SizeInUsageFile()); |
| 331 GetUsageAndQuotaFromQuotaManager(); | 330 GetUsageAndQuotaFromQuotaManager(); |
| 332 EXPECT_EQ(quota::kQuotaStatusOk, quota_status()); | 331 EXPECT_EQ(quota::kQuotaStatusOk, quota_status()); |
| 333 EXPECT_EQ(2 * child_file_size + 3 * grandchild_file_size, usage()); | 332 EXPECT_EQ(2 * child_file_size + 3 * grandchild_file_size, usage()); |
| 334 ASSERT_LT(2 * child_file_size + 3 * grandchild_file_size, quota()); | 333 ASSERT_LT(2 * child_file_size + 3 * grandchild_file_size, quota()); |
| 335 } | 334 } |
| 336 | 335 |
| 337 } // namespace fileapi | 336 } // namespace fileapi |
| OLD | NEW |