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 "content/browser/quota/mock_quota_manager.h" | 5 #include "content/browser/quota/mock_quota_manager.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 class MockQuotaManagerTest : public testing::Test { | 40 class MockQuotaManagerTest : public testing::Test { |
41 public: | 41 public: |
42 MockQuotaManagerTest() | 42 MockQuotaManagerTest() |
43 : deletion_callback_count_(0), | 43 : deletion_callback_count_(0), |
44 weak_factory_(this) { | 44 weak_factory_(this) { |
45 } | 45 } |
46 | 46 |
47 void SetUp() override { | 47 void SetUp() override { |
48 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); | 48 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); |
49 policy_ = new MockSpecialStoragePolicy; | 49 policy_ = new MockSpecialStoragePolicy; |
50 manager_ = new MockQuotaManager(false /* is_incognito */, data_dir_.path(), | 50 manager_ = new MockQuotaManager( |
51 base::ThreadTaskRunnerHandle::Get().get(), | 51 false /* is_incognito */, data_dir_.GetPath(), |
52 base::ThreadTaskRunnerHandle::Get().get(), | 52 base::ThreadTaskRunnerHandle::Get().get(), |
53 policy_.get()); | 53 base::ThreadTaskRunnerHandle::Get().get(), policy_.get()); |
54 } | 54 } |
55 | 55 |
56 void TearDown() override { | 56 void TearDown() override { |
57 // Make sure the quota manager cleans up correctly. | 57 // Make sure the quota manager cleans up correctly. |
58 manager_ = NULL; | 58 manager_ = NULL; |
59 base::RunLoop().RunUntilIdle(); | 59 base::RunLoop().RunUntilIdle(); |
60 } | 60 } |
61 | 61 |
62 void GetModifiedOrigins(StorageType type, base::Time since) { | 62 void GetModifiedOrigins(StorageType type, base::Time since) { |
63 manager_->GetOriginsModifiedSince( | 63 manager_->GetOriginsModifiedSince( |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 | 218 |
219 GetModifiedOrigins(kTemporary, now - a_minute); | 219 GetModifiedOrigins(kTemporary, now - a_minute); |
220 base::RunLoop().RunUntilIdle(); | 220 base::RunLoop().RunUntilIdle(); |
221 | 221 |
222 EXPECT_EQ(kTemporary, type()); | 222 EXPECT_EQ(kTemporary, type()); |
223 EXPECT_EQ(1UL, origins().size()); | 223 EXPECT_EQ(1UL, origins().size()); |
224 EXPECT_EQ(0UL, origins().count(kOrigin1)); | 224 EXPECT_EQ(0UL, origins().count(kOrigin1)); |
225 EXPECT_EQ(1UL, origins().count(kOrigin2)); | 225 EXPECT_EQ(1UL, origins().count(kOrigin2)); |
226 } | 226 } |
227 } // namespace content | 227 } // namespace content |
OLD | NEW |