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

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

Issue 1343273003: Integrate SiteEngagementEvictionPolicy with QuotaManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add_eviction_policy
Patch Set: rebase Created 5 years, 3 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 quota_manager_->NotifyStorageAccessedInternal( 272 quota_manager_->NotifyStorageAccessedInternal(
273 client->id(), origin, type, IncrementMockTime()); 273 client->id(), origin, type, IncrementMockTime());
274 } 274 }
275 275
276 void DeleteOriginFromDatabase(const GURL& origin, StorageType type) { 276 void DeleteOriginFromDatabase(const GURL& origin, StorageType type) {
277 quota_manager_->DeleteOriginFromDatabase(origin, type); 277 quota_manager_->DeleteOriginFromDatabase(origin, type);
278 } 278 }
279 279
280 void GetLRUOrigin(StorageType type) { 280 void GetLRUOrigin(StorageType type) {
281 lru_origin_ = GURL(); 281 lru_origin_ = GURL();
282 quota_manager_->GetLRUOrigin( 282 // The quota manager's default eviction policy is to use an LRU eviction
283 type, 283 // policy.
284 base::Bind(&QuotaManagerTest::DidGetLRUOrigin, 284 quota_manager_->GetEvictionOrigin(
285 weak_factory_.GetWeakPtr())); 285 type, base::Bind(&QuotaManagerTest::DidGetLRUOrigin,
286 weak_factory_.GetWeakPtr()));
286 } 287 }
287 288
288 void NotifyOriginInUse(const GURL& origin) { 289 void NotifyOriginInUse(const GURL& origin) {
289 quota_manager_->NotifyOriginInUse(origin); 290 quota_manager_->NotifyOriginInUse(origin);
290 } 291 }
291 292
292 void NotifyOriginNoLongerInUse(const GURL& origin) { 293 void NotifyOriginNoLongerInUse(const GURL& origin) {
293 quota_manager_->NotifyOriginNoLongerInUse(origin); 294 quota_manager_->NotifyOriginNoLongerInUse(origin);
294 } 295 }
295 296
(...skipping 1881 matching lines...) Expand 10 before | Expand all | Expand 10 after
2177 EXPECT_EQ(QuotaManager::kIncognitoDefaultQuotaLimit, quota()); 2178 EXPECT_EQ(QuotaManager::kIncognitoDefaultQuotaLimit, quota());
2178 2179
2179 GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); 2180 GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp);
2180 base::RunLoop().RunUntilIdle(); 2181 base::RunLoop().RunUntilIdle();
2181 EXPECT_EQ(kQuotaStatusOk, status()); 2182 EXPECT_EQ(kQuotaStatusOk, status());
2182 EXPECT_EQ(10, usage()); 2183 EXPECT_EQ(10, usage());
2183 EXPECT_EQ(QuotaManager::kIncognitoDefaultQuotaLimit, quota()); 2184 EXPECT_EQ(QuotaManager::kIncognitoDefaultQuotaLimit, quota());
2184 } 2185 }
2185 2186
2186 } // namespace content 2187 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698