Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(485)

Side by Side Diff: content/browser/quota/quota_manager_unittest.cc

Issue 1354543002: Exclude in-use origins from storage evictions for all QuotaEvictionPolicies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hook_it_up_gooood
Patch Set: address comment Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/engagement/site_engagement_eviction_policy_unittest.cc ('k') | storage/browser/quota/quota_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698