OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <algorithm> | 5 #include <algorithm> |
6 #include <set> | 6 #include <set> |
7 #include <sstream> | 7 #include <sstream> |
8 #include <vector> | 8 #include <vector> |
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/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "base/message_loop/message_loop_proxy.h" | 15 #include "base/message_loop/message_loop_proxy.h" |
16 #include "base/run_loop.h" | 16 #include "base/run_loop.h" |
17 #include "base/stl_util.h" | 17 #include "base/stl_util.h" |
18 #include "base/sys_info.h" | 18 #include "base/sys_info.h" |
19 #include "base/time/time.h" | 19 #include "base/time/time.h" |
20 #include "content/public/test/mock_special_storage_policy.h" | 20 #include "content/public/test/mock_special_storage_policy.h" |
21 #include "content/public/test/mock_storage_client.h" | 21 #include "content/public/test/mock_storage_client.h" |
22 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
23 #include "url/gurl.h" | 23 #include "url/gurl.h" |
24 #include "webkit/browser/quota/quota_database.h" | 24 #include "webkit/browser/quota/quota_database.h" |
25 #include "webkit/browser/quota/quota_manager.h" | 25 #include "webkit/browser/quota/quota_manager.h" |
26 #include "webkit/browser/quota/quota_manager_proxy.h" | 26 #include "webkit/browser/quota/quota_manager_proxy.h" |
27 | 27 |
28 using base::MessageLoopProxy; | 28 using base::MessageLoopProxy; |
29 using quota::kQuotaErrorAbort; | 29 using storage::kQuotaErrorAbort; |
30 using quota::kQuotaErrorInvalidModification; | 30 using storage::kQuotaErrorInvalidModification; |
31 using quota::kQuotaErrorNotSupported; | 31 using storage::kQuotaErrorNotSupported; |
32 using quota::kQuotaStatusOk; | 32 using storage::kQuotaStatusOk; |
33 using quota::kQuotaStatusUnknown; | 33 using storage::kQuotaStatusUnknown; |
34 using quota::kStorageTypePersistent; | 34 using storage::kStorageTypePersistent; |
35 using quota::kStorageTypeSyncable; | 35 using storage::kStorageTypeSyncable; |
36 using quota::kStorageTypeTemporary; | 36 using storage::kStorageTypeTemporary; |
37 using quota::kStorageTypeUnknown; | 37 using storage::kStorageTypeUnknown; |
38 using quota::QuotaClient; | 38 using storage::QuotaClient; |
39 using quota::QuotaManager; | 39 using storage::QuotaManager; |
40 using quota::QuotaStatusCode; | 40 using storage::QuotaStatusCode; |
41 using quota::StorageType; | 41 using storage::StorageType; |
42 using quota::UsageAndQuota; | 42 using storage::UsageAndQuota; |
43 using quota::UsageInfo; | 43 using storage::UsageInfo; |
44 using quota::UsageInfoEntries; | 44 using storage::UsageInfoEntries; |
45 | 45 |
46 namespace content { | 46 namespace content { |
47 | 47 |
48 namespace { | 48 namespace { |
49 | 49 |
50 // For shorter names. | 50 // For shorter names. |
51 const StorageType kTemp = kStorageTypeTemporary; | 51 const StorageType kTemp = kStorageTypeTemporary; |
52 const StorageType kPerm = kStorageTypePersistent; | 52 const StorageType kPerm = kStorageTypePersistent; |
53 const StorageType kSync = kStorageTypeSyncable; | 53 const StorageType kSync = kStorageTypeSyncable; |
54 | 54 |
(...skipping 2126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2181 EXPECT_EQ(QuotaManager::kIncognitoDefaultQuotaLimit, quota()); | 2181 EXPECT_EQ(QuotaManager::kIncognitoDefaultQuotaLimit, quota()); |
2182 | 2182 |
2183 GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); | 2183 GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); |
2184 base::RunLoop().RunUntilIdle(); | 2184 base::RunLoop().RunUntilIdle(); |
2185 EXPECT_EQ(kQuotaStatusOk, status()); | 2185 EXPECT_EQ(kQuotaStatusOk, status()); |
2186 EXPECT_EQ(10, usage()); | 2186 EXPECT_EQ(10, usage()); |
2187 EXPECT_EQ(QuotaManager::kIncognitoDefaultQuotaLimit, quota()); | 2187 EXPECT_EQ(QuotaManager::kIncognitoDefaultQuotaLimit, quota()); |
2188 } | 2188 } |
2189 | 2189 |
2190 } // namespace content | 2190 } // namespace content |
OLD | NEW |