| 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" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 } | 66 } |
| 67 | 67 |
| 68 class TestEvictionPolicy : public storage::QuotaEvictionPolicy { | 68 class TestEvictionPolicy : public storage::QuotaEvictionPolicy { |
| 69 public: | 69 public: |
| 70 TestEvictionPolicy() {} | 70 TestEvictionPolicy() {} |
| 71 ~TestEvictionPolicy() override {} | 71 ~TestEvictionPolicy() override {} |
| 72 | 72 |
| 73 // Overridden from storage::QuotaEvictionPolicy: | 73 // Overridden from storage::QuotaEvictionPolicy: |
| 74 void GetEvictionOrigin(const scoped_refptr<storage::SpecialStoragePolicy>& | 74 void GetEvictionOrigin(const scoped_refptr<storage::SpecialStoragePolicy>& |
| 75 special_storage_policy, | 75 special_storage_policy, |
| 76 const std::set<GURL>& exceptions, |
| 76 const std::map<GURL, int64>& usage_map, | 77 const std::map<GURL, int64>& usage_map, |
| 77 int64 global_quota, | 78 int64 global_quota, |
| 78 const storage::GetOriginCallback& callback) override { | 79 const storage::GetOriginCallback& callback) override { |
| 79 callback.Run(kTestEvictionOrigin); | 80 callback.Run(kTestEvictionOrigin); |
| 80 } | 81 } |
| 81 }; | 82 }; |
| 82 | 83 |
| 83 } // namespace | 84 } // namespace |
| 84 | 85 |
| 85 class QuotaManagerTest : public testing::Test { | 86 class QuotaManagerTest : public testing::Test { |
| (...skipping 2118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2204 EXPECT_EQ(QuotaManager::kIncognitoDefaultQuotaLimit, quota()); | 2205 EXPECT_EQ(QuotaManager::kIncognitoDefaultQuotaLimit, quota()); |
| 2205 | 2206 |
| 2206 GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); | 2207 GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); |
| 2207 base::RunLoop().RunUntilIdle(); | 2208 base::RunLoop().RunUntilIdle(); |
| 2208 EXPECT_EQ(kQuotaStatusOk, status()); | 2209 EXPECT_EQ(kQuotaStatusOk, status()); |
| 2209 EXPECT_EQ(10, usage()); | 2210 EXPECT_EQ(10, usage()); |
| 2210 EXPECT_EQ(QuotaManager::kIncognitoDefaultQuotaLimit, quota()); | 2211 EXPECT_EQ(QuotaManager::kIncognitoDefaultQuotaLimit, quota()); |
| 2211 } | 2212 } |
| 2212 | 2213 |
| 2213 } // namespace content | 2214 } // namespace content |
| OLD | NEW |