| 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 #include "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/basictypes.h" | 6 #include "base/basictypes.h" |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 bool isDirectory; | 59 bool isDirectory; |
| 60 const char* name; | 60 const char* name; |
| 61 int64 size; | 61 int64 size; |
| 62 const char* origin_url; | 62 const char* origin_url; |
| 63 quota::StorageType type; | 63 quota::StorageType type; |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 protected: | 66 protected: |
| 67 FileSystemQuotaClient* NewQuotaClient(bool is_incognito) { | 67 FileSystemQuotaClient* NewQuotaClient(bool is_incognito) { |
| 68 return new FileSystemQuotaClient( | 68 return new FileSystemQuotaClient( |
| 69 base::MessageLoopProxy::current(), | |
| 70 file_system_context_, is_incognito); | 69 file_system_context_, is_incognito); |
| 71 } | 70 } |
| 72 | 71 |
| 73 void GetOriginUsageAsync(FileSystemQuotaClient* quota_client, | 72 void GetOriginUsageAsync(FileSystemQuotaClient* quota_client, |
| 74 const std::string& origin_url, | 73 const std::string& origin_url, |
| 75 quota::StorageType type) { | 74 quota::StorageType type) { |
| 76 quota_client->GetOriginUsage( | 75 quota_client->GetOriginUsage( |
| 77 GURL(origin_url), type, | 76 GURL(origin_url), type, |
| 78 base::Bind(&FileSystemQuotaClientTest::OnGetUsage, | 77 base::Bind(&FileSystemQuotaClientTest::OnGetUsage, |
| 79 weak_factory_.GetWeakPtr())); | 78 weak_factory_.GetWeakPtr())); |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 GetOriginUsage(quota_client.get(), | 579 GetOriginUsage(quota_client.get(), |
| 581 "https://bar.com/", | 580 "https://bar.com/", |
| 582 kPersistent)); | 581 kPersistent)); |
| 583 EXPECT_EQ(64 + file_paths_cost_temporary_bar_https, | 582 EXPECT_EQ(64 + file_paths_cost_temporary_bar_https, |
| 584 GetOriginUsage(quota_client.get(), | 583 GetOriginUsage(quota_client.get(), |
| 585 "https://bar.com/", | 584 "https://bar.com/", |
| 586 kTemporary)); | 585 kTemporary)); |
| 587 } | 586 } |
| 588 | 587 |
| 589 } // namespace fileapi | 588 } // namespace fileapi |
| OLD | NEW |