| 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" |
| 11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
| 12 #include "base/files/scoped_temp_dir.h" | 12 #include "base/files/scoped_temp_dir.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/message_loop.h" | 16 #include "base/message_loop.h" |
| 17 #include "base/platform_file.h" | 17 #include "base/platform_file.h" |
| 18 #include "base/strings/string_number_conversions.h" | 18 #include "base/strings/string_number_conversions.h" |
| 19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 20 #include "webkit/browser/fileapi/file_system_file_util.h" |
| 20 #include "webkit/browser/fileapi/file_system_usage_cache.h" | 21 #include "webkit/browser/fileapi/file_system_usage_cache.h" |
| 21 #include "webkit/fileapi/async_file_test_helper.h" | 22 #include "webkit/fileapi/async_file_test_helper.h" |
| 22 #include "webkit/fileapi/file_system_file_util.h" | |
| 23 #include "webkit/fileapi/file_system_operation_context.h" | 23 #include "webkit/fileapi/file_system_operation_context.h" |
| 24 #include "webkit/fileapi/file_system_util.h" | 24 #include "webkit/fileapi/file_system_util.h" |
| 25 #include "webkit/fileapi/local_file_system_operation.h" | 25 #include "webkit/fileapi/local_file_system_operation.h" |
| 26 #include "webkit/fileapi/local_file_system_test_helper.h" | 26 #include "webkit/fileapi/local_file_system_test_helper.h" |
| 27 #include "webkit/quota/quota_manager.h" | 27 #include "webkit/quota/quota_manager.h" |
| 28 | 28 |
| 29 namespace fileapi { | 29 namespace fileapi { |
| 30 | 30 |
| 31 const int kFileOperationStatusNotSet = 1; | 31 const int kFileOperationStatusNotSet = 1; |
| 32 | 32 |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 | 338 |
| 339 EXPECT_EQ(2 * child_file_size + 3 * grandchild_file_size, ActualFileSize()); | 339 EXPECT_EQ(2 * child_file_size + 3 * grandchild_file_size, ActualFileSize()); |
| 340 EXPECT_EQ(expected_usage, SizeByQuotaUtil()); | 340 EXPECT_EQ(expected_usage, SizeByQuotaUtil()); |
| 341 GetUsageAndQuotaFromQuotaManager(); | 341 GetUsageAndQuotaFromQuotaManager(); |
| 342 EXPECT_EQ(quota::kQuotaStatusOk, quota_status()); | 342 EXPECT_EQ(quota::kQuotaStatusOk, quota_status()); |
| 343 EXPECT_EQ(expected_usage, usage()); | 343 EXPECT_EQ(expected_usage, usage()); |
| 344 ASSERT_LT(expected_usage, quota()); | 344 ASSERT_LT(expected_usage, quota()); |
| 345 } | 345 } |
| 346 | 346 |
| 347 } // namespace fileapi | 347 } // namespace fileapi |
| OLD | NEW |