OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 5 |
6 #include <set> | 6 #include <set> |
7 | 7 |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/memory/scoped_callback_factory.h" | 9 #include "base/memory/scoped_callback_factory.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 : callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 32 : callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
33 deletion_callback_count_(0) { | 33 deletion_callback_count_(0) { |
34 } | 34 } |
35 | 35 |
36 void SetUp() { | 36 void SetUp() { |
37 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); | 37 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); |
38 policy_ = new MockSpecialStoragePolicy; | 38 policy_ = new MockSpecialStoragePolicy; |
39 manager_ = new MockQuotaManager( | 39 manager_ = new MockQuotaManager( |
40 false /* is_incognito */, | 40 false /* is_incognito */, |
41 data_dir_.path(), | 41 data_dir_.path(), |
42 base::MessageLoopProxy::CreateForCurrentThread(), | 42 base::MessageLoopProxy::current(), |
43 base::MessageLoopProxy::CreateForCurrentThread(), | 43 base::MessageLoopProxy::current(), |
44 policy_); | 44 policy_); |
45 } | 45 } |
46 | 46 |
47 void TearDown() { | 47 void TearDown() { |
48 // Make sure the quota manager cleans up correctly. | 48 // Make sure the quota manager cleans up correctly. |
49 manager_ = NULL; | 49 manager_ = NULL; |
50 MessageLoop::current()->RunAllPending(); | 50 MessageLoop::current()->RunAllPending(); |
51 } | 51 } |
52 | 52 |
53 void GetModifiedOrigins(StorageType type, base::Time since) { | 53 void GetModifiedOrigins(StorageType type, base::Time since) { |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 171 |
172 GetModifiedOrigins(kStorageTypeTemporary, now - a_minute); | 172 GetModifiedOrigins(kStorageTypeTemporary, now - a_minute); |
173 MessageLoop::current()->RunAllPending(); | 173 MessageLoop::current()->RunAllPending(); |
174 | 174 |
175 EXPECT_EQ(kStorageTypeTemporary, type()); | 175 EXPECT_EQ(kStorageTypeTemporary, type()); |
176 EXPECT_EQ(1UL, origins().size()); | 176 EXPECT_EQ(1UL, origins().size()); |
177 EXPECT_EQ(0UL, origins().count(kOrigin1)); | 177 EXPECT_EQ(0UL, origins().count(kOrigin1)); |
178 EXPECT_EQ(1UL, origins().count(kOrigin2)); | 178 EXPECT_EQ(1UL, origins().count(kOrigin2)); |
179 } | 179 } |
180 } // Namespace quota | 180 } // Namespace quota |
OLD | NEW |