OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 } | 67 } |
68 | 68 |
69 virtual void TearDown() { | 69 virtual void TearDown() { |
70 // Make sure the quota manager cleans up correctly. | 70 // Make sure the quota manager cleans up correctly. |
71 quota_manager_ = NULL; | 71 quota_manager_ = NULL; |
72 base::MessageLoop::current()->RunUntilIdle(); | 72 base::MessageLoop::current()->RunUntilIdle(); |
73 } | 73 } |
74 | 74 |
75 protected: | 75 protected: |
76 void ResetQuotaManager(bool is_incognito) { | 76 void ResetQuotaManager(bool is_incognito) { |
77 quota_manager_ = new QuotaManager( | 77 quota_manager_ = new QuotaManager(is_incognito, |
78 is_incognito, | 78 data_dir_.path(), |
79 data_dir_.path(), | 79 MessageLoopProxy::current(), |
80 MessageLoopProxy::current(), | 80 MessageLoopProxy::current(), |
81 MessageLoopProxy::current(), | 81 mock_special_storage_policy_.get()); |
82 mock_special_storage_policy_); | |
83 // Don't (automatically) start the eviction for testing. | 82 // Don't (automatically) start the eviction for testing. |
84 quota_manager_->eviction_disabled_ = true; | 83 quota_manager_->eviction_disabled_ = true; |
85 // Don't query the hard disk for remaining capacity. | 84 // Don't query the hard disk for remaining capacity. |
86 quota_manager_->get_disk_space_fn_ = &GetAvailableDiskSpaceForTest; | 85 quota_manager_->get_disk_space_fn_ = &GetAvailableDiskSpaceForTest; |
87 additional_callback_count_ = 0; | 86 additional_callback_count_ = 0; |
88 } | 87 } |
89 | 88 |
90 MockStorageClient* CreateClient( | 89 MockStorageClient* CreateClient( |
91 const MockOriginData* mock_data, | 90 const MockOriginData* mock_data, |
92 size_t mock_data_size, | 91 size_t mock_data_size, |
(...skipping 2063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2156 EXPECT_EQ(QuotaManager::kIncognitoDefaultQuotaLimit, quota()); | 2155 EXPECT_EQ(QuotaManager::kIncognitoDefaultQuotaLimit, quota()); |
2157 | 2156 |
2158 GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); | 2157 GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); |
2159 base::MessageLoop::current()->RunUntilIdle(); | 2158 base::MessageLoop::current()->RunUntilIdle(); |
2160 EXPECT_EQ(kQuotaStatusOk, status()); | 2159 EXPECT_EQ(kQuotaStatusOk, status()); |
2161 EXPECT_EQ(10, usage()); | 2160 EXPECT_EQ(10, usage()); |
2162 EXPECT_EQ(QuotaManager::kIncognitoDefaultQuotaLimit, quota()); | 2161 EXPECT_EQ(QuotaManager::kIncognitoDefaultQuotaLimit, quota()); |
2163 } | 2162 } |
2164 | 2163 |
2165 } // namespace quota | 2164 } // namespace quota |
OLD | NEW |