| 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 #include <set> | 5 #include <set> |
| 6 #include <sstream> | 6 #include <sstream> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/memory/scoped_callback_factory.h" | 10 #include "base/memory/scoped_callback_factory.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 : callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 45 : callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
| 46 mock_time_counter_(0) { | 46 mock_time_counter_(0) { |
| 47 } | 47 } |
| 48 | 48 |
| 49 void SetUp() { | 49 void SetUp() { |
| 50 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); | 50 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); |
| 51 mock_special_storage_policy_ = new MockSpecialStoragePolicy; | 51 mock_special_storage_policy_ = new MockSpecialStoragePolicy; |
| 52 quota_manager_ = new QuotaManager( | 52 quota_manager_ = new QuotaManager( |
| 53 false /* is_incognito */, | 53 false /* is_incognito */, |
| 54 data_dir_.path(), | 54 data_dir_.path(), |
| 55 MessageLoopProxy::CreateForCurrentThread(), | 55 MessageLoopProxy::current(), |
| 56 MessageLoopProxy::CreateForCurrentThread(), | 56 MessageLoopProxy::current(), |
| 57 mock_special_storage_policy_); | 57 mock_special_storage_policy_); |
| 58 // Don't (automatically) start the eviction for testing. | 58 // Don't (automatically) start the eviction for testing. |
| 59 quota_manager_->eviction_disabled_ = true; | 59 quota_manager_->eviction_disabled_ = true; |
| 60 additional_callback_count_ = 0; | 60 additional_callback_count_ = 0; |
| 61 } | 61 } |
| 62 | 62 |
| 63 void TearDown() { | 63 void TearDown() { |
| 64 // Make sure the quota manager cleans up correctly. | 64 // Make sure the quota manager cleans up correctly. |
| 65 quota_manager_ = NULL; | 65 quota_manager_ = NULL; |
| 66 MessageLoop::current()->RunAllPending(); | 66 MessageLoop::current()->RunAllPending(); |
| (...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1553 GetPersistentHostQuota(std::string()); | 1553 GetPersistentHostQuota(std::string()); |
| 1554 MessageLoop::current()->RunAllPending(); | 1554 MessageLoop::current()->RunAllPending(); |
| 1555 EXPECT_EQ(kQuotaStatusOk, status()); | 1555 EXPECT_EQ(kQuotaStatusOk, status()); |
| 1556 EXPECT_EQ(0, quota()); | 1556 EXPECT_EQ(0, quota()); |
| 1557 | 1557 |
| 1558 SetPersistentHostQuota(std::string(), 10); | 1558 SetPersistentHostQuota(std::string(), 10); |
| 1559 MessageLoop::current()->RunAllPending(); | 1559 MessageLoop::current()->RunAllPending(); |
| 1560 EXPECT_EQ(kQuotaErrorNotSupported, status()); | 1560 EXPECT_EQ(kQuotaErrorNotSupported, status()); |
| 1561 } | 1561 } |
| 1562 } // namespace quota | 1562 } // namespace quota |
| OLD | NEW |