| 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 #include "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/memory/scoped_callback_factory.h" | 7 #include "base/memory/scoped_callback_factory.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
| 10 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 callback_factory_.NewCallback( | 119 callback_factory_.NewCallback( |
| 120 &FileSystemQuotaClientTest::OnGetAdditionalUsage)); | 120 &FileSystemQuotaClientTest::OnGetAdditionalUsage)); |
| 121 } | 121 } |
| 122 | 122 |
| 123 FilePath GetOriginBasePath(const char* origin_url, | 123 FilePath GetOriginBasePath(const char* origin_url, |
| 124 quota::StorageType type) { | 124 quota::StorageType type) { |
| 125 // Note: this test assumes sandbox_provider impl is used for | 125 // Note: this test assumes sandbox_provider impl is used for |
| 126 // temporary and persistent filesystem. | 126 // temporary and persistent filesystem. |
| 127 return file_system_context_->path_manager()->sandbox_provider()-> | 127 return file_system_context_->path_manager()->sandbox_provider()-> |
| 128 GetBaseDirectoryForOriginAndType( | 128 GetBaseDirectoryForOriginAndType( |
| 129 GURL(origin_url), QuotaStorageTypeToFileSystemType(type)); | 129 GURL(origin_url), QuotaStorageTypeToFileSystemType(type), true); |
| 130 } | 130 } |
| 131 | 131 |
| 132 bool CreateFileSystemDirectory(const char* dir_name, | 132 bool CreateFileSystemDirectory(const char* dir_name, |
| 133 const char* origin_url, | 133 const char* origin_url, |
| 134 quota::StorageType type) { | 134 quota::StorageType type) { |
| 135 FilePath origin_base_path = GetOriginBasePath(origin_url, type); | 135 FilePath origin_base_path = GetOriginBasePath(origin_url, type); |
| 136 FilePath dir_path; | 136 FilePath dir_path; |
| 137 if (dir_name != NULL) | 137 if (dir_name != NULL) |
| 138 dir_path = origin_base_path.AppendASCII(dir_name); | 138 dir_path = origin_base_path.AppendASCII(dir_name); |
| 139 else | 139 else |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 GetOriginUsage(quota_client.get(), | 505 GetOriginUsage(quota_client.get(), |
| 506 "https://bar.com/", | 506 "https://bar.com/", |
| 507 kPersistent)); | 507 kPersistent)); |
| 508 EXPECT_EQ(64 + kUsageFileSize, | 508 EXPECT_EQ(64 + kUsageFileSize, |
| 509 GetOriginUsage(quota_client.get(), | 509 GetOriginUsage(quota_client.get(), |
| 510 "https://bar.com/", | 510 "https://bar.com/", |
| 511 kTemporary)); | 511 kTemporary)); |
| 512 } | 512 } |
| 513 | 513 |
| 514 } // namespace fileapi | 514 } // namespace fileapi |
| OLD | NEW |