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

Side by Side Diff: chrome/browser/engagement/site_engagement_eviction_policy_unittest.cc

Issue 2368913003: Populate storage_unittests target. (Closed)
Patch Set: Removed unnecessary include from storage/browser/blob/blob_storage_context_unittest.cc. Created 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/engagement/site_engagement_eviction_policy.h" 5 #include "chrome/browser/engagement/site_engagement_eviction_policy.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
11 #include "base/files/scoped_temp_dir.h" 11 #include "base/files/scoped_temp_dir.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "base/run_loop.h" 14 #include "base/run_loop.h"
15 #include "base/threading/thread_task_runner_handle.h" 15 #include "base/threading/thread_task_runner_handle.h"
16 #include "chrome/browser/engagement/site_engagement_service.h" 16 #include "chrome/browser/engagement/site_engagement_service.h"
17 #include "content/public/test/mock_special_storage_policy.h"
18 #include "content/public/test/mock_storage_client.h"
19 #include "content/public/test/test_browser_thread_bundle.h" 17 #include "content/public/test/test_browser_thread_bundle.h"
20 #include "storage/browser/quota/quota_manager.h" 18 #include "storage/browser/quota/quota_manager.h"
21 #include "storage/browser/quota/quota_manager_proxy.h" 19 #include "storage/browser/quota/quota_manager_proxy.h"
20 #include "storage/browser/test/mock_special_storage_policy.h"
21 #include "storage/browser/test/mock_storage_client.h"
22 #include "testing/gtest/include/gtest/gtest.h" 22 #include "testing/gtest/include/gtest/gtest.h"
23 23
24 namespace { 24 namespace {
25 25
26 const int64_t kGlobalQuota = 25 * 1024; 26 const int64_t kGlobalQuota = 25 * 1024;
27 27
28 } // namespace 28 } // namespace
29 29
30 class TestSiteEngagementScoreProvider : public SiteEngagementScoreProvider { 30 class TestSiteEngagementScoreProvider : public SiteEngagementScoreProvider {
31 public: 31 public:
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 score_provider()->SetScore(url1, 50); 164 score_provider()->SetScore(url1, 50);
165 score_provider()->SetScore(url2, 25); 165 score_provider()->SetScore(url2, 25);
166 166
167 EXPECT_EQ(url2, CalculateEvictionOrigin(usage)); 167 EXPECT_EQ(url2, CalculateEvictionOrigin(usage));
168 168
169 // The policy should respect exceptions. 169 // The policy should respect exceptions.
170 std::set<GURL> exceptions; 170 std::set<GURL> exceptions;
171 exceptions.insert(url2); 171 exceptions.insert(url2);
172 EXPECT_EQ(url1, CalculateEvictionOriginWithExceptions(usage, exceptions)); 172 EXPECT_EQ(url1, CalculateEvictionOriginWithExceptions(usage, exceptions));
173 } 173 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698