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 #include "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 BrowsingDataQuotaHelperTest() : weak_factory_(this) {} | 31 BrowsingDataQuotaHelperTest() : weak_factory_(this) {} |
32 | 32 |
33 ~BrowsingDataQuotaHelperTest() override {} | 33 ~BrowsingDataQuotaHelperTest() override {} |
34 | 34 |
35 void SetUp() override { | 35 void SetUp() override { |
36 EXPECT_TRUE(dir_.CreateUniqueTempDir()); | 36 EXPECT_TRUE(dir_.CreateUniqueTempDir()); |
37 quota_manager_ = new storage::QuotaManager( | 37 quota_manager_ = new storage::QuotaManager( |
38 false, dir_.GetPath(), | 38 false, dir_.GetPath(), |
39 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO).get(), | 39 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO).get(), |
40 BrowserThread::GetTaskRunnerForThread(BrowserThread::DB).get(), | 40 BrowserThread::GetTaskRunnerForThread(BrowserThread::DB).get(), nullptr, |
41 nullptr); | 41 storage::GetQuotaSettingsFunc()); |
42 helper_ = new BrowsingDataQuotaHelperImpl(quota_manager_.get()); | 42 helper_ = new BrowsingDataQuotaHelperImpl(quota_manager_.get()); |
43 } | 43 } |
44 | 44 |
45 void TearDown() override { | 45 void TearDown() override { |
46 helper_ = nullptr; | 46 helper_ = nullptr; |
47 quota_manager_ = nullptr; | 47 quota_manager_ = nullptr; |
48 quota_info_.clear(); | 48 quota_info_.clear(); |
49 base::RunLoop().RunUntilIdle(); | 49 base::RunLoop().RunUntilIdle(); |
50 } | 50 } |
51 | 51 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 base::RunLoop().RunUntilIdle(); | 191 base::RunLoop().RunUntilIdle(); |
192 | 192 |
193 GetPersistentHostQuota(kHost1); | 193 GetPersistentHostQuota(kHost1); |
194 base::RunLoop().RunUntilIdle(); | 194 base::RunLoop().RunUntilIdle(); |
195 EXPECT_EQ(0, quota()); | 195 EXPECT_EQ(0, quota()); |
196 | 196 |
197 GetPersistentHostQuota(kHost2); | 197 GetPersistentHostQuota(kHost2); |
198 base::RunLoop().RunUntilIdle(); | 198 base::RunLoop().RunUntilIdle(); |
199 EXPECT_EQ(10, quota()); | 199 EXPECT_EQ(10, quota()); |
200 } | 200 } |
OLD | NEW |