| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 const StorageType kTemporary = kStorageTypeTemporary; | 29 const StorageType kTemporary = kStorageTypeTemporary; |
| 30 const StorageType kPersistent = kStorageTypePersistent; | 30 const StorageType kPersistent = kStorageTypePersistent; |
| 31 | 31 |
| 32 const QuotaClient::ID kClientFile = QuotaClient::kFileSystem; | 32 const QuotaClient::ID kClientFile = QuotaClient::kFileSystem; |
| 33 const QuotaClient::ID kClientDB = QuotaClient::kIndexedDatabase; | 33 const QuotaClient::ID kClientDB = QuotaClient::kIndexedDatabase; |
| 34 | 34 |
| 35 class MockQuotaManagerTest : public testing::Test { | 35 class MockQuotaManagerTest : public testing::Test { |
| 36 public: | 36 public: |
| 37 MockQuotaManagerTest() | 37 MockQuotaManagerTest() |
| 38 : weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 38 : weak_factory_(this), |
| 39 deletion_callback_count_(0) { | 39 deletion_callback_count_(0) { |
| 40 } | 40 } |
| 41 | 41 |
| 42 virtual void SetUp() { | 42 virtual void SetUp() { |
| 43 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); | 43 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); |
| 44 policy_ = new MockSpecialStoragePolicy; | 44 policy_ = new MockSpecialStoragePolicy; |
| 45 manager_ = new MockQuotaManager( | 45 manager_ = new MockQuotaManager( |
| 46 false /* is_incognito */, | 46 false /* is_incognito */, |
| 47 data_dir_.path(), | 47 data_dir_.path(), |
| 48 base::MessageLoopProxy::current(), | 48 base::MessageLoopProxy::current(), |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 | 214 |
| 215 GetModifiedOrigins(kTemporary, now - a_minute); | 215 GetModifiedOrigins(kTemporary, now - a_minute); |
| 216 MessageLoop::current()->RunUntilIdle(); | 216 MessageLoop::current()->RunUntilIdle(); |
| 217 | 217 |
| 218 EXPECT_EQ(kTemporary, type()); | 218 EXPECT_EQ(kTemporary, type()); |
| 219 EXPECT_EQ(1UL, origins().size()); | 219 EXPECT_EQ(1UL, origins().size()); |
| 220 EXPECT_EQ(0UL, origins().count(kOrigin1)); | 220 EXPECT_EQ(0UL, origins().count(kOrigin1)); |
| 221 EXPECT_EQ(1UL, origins().count(kOrigin2)); | 221 EXPECT_EQ(1UL, origins().count(kOrigin2)); |
| 222 } | 222 } |
| 223 } // Namespace quota | 223 } // Namespace quota |
| OLD | NEW |