OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/mock_browsing_data_quota_helper.h" | |
6 | |
7 using content::BrowserThread; | |
8 | |
9 MockBrowsingDataQuotaHelper::MockBrowsingDataQuotaHelper(Profile* profile) | |
10 : BrowsingDataQuotaHelper(BrowserThread::GetMessageLoopProxyForThread( | |
11 BrowserThread::IO)) {} | |
12 | |
13 MockBrowsingDataQuotaHelper::~MockBrowsingDataQuotaHelper() {} | |
14 | |
15 void MockBrowsingDataQuotaHelper::StartFetching( | |
16 const FetchResultCallback& callback) { | |
17 callback_ = callback; | |
18 } | |
19 | |
20 void MockBrowsingDataQuotaHelper::RevokeHostQuota(const std::string& host) { | |
21 } | |
22 | |
23 void MockBrowsingDataQuotaHelper::AddHost( | |
24 const std::string& host, | |
25 int64 temporary_usage, | |
26 int64 persistent_usage) { | |
27 response_.push_back(QuotaInfo( | |
28 host, | |
29 temporary_usage, | |
30 persistent_usage)); | |
31 } | |
32 | |
33 void MockBrowsingDataQuotaHelper::AddQuotaSamples() { | |
34 AddHost("quotahost1", 1, 2); | |
35 AddHost("quotahost2", 10, 20); | |
36 } | |
37 | |
38 void MockBrowsingDataQuotaHelper::Notify() { | |
39 CHECK_EQ(false, callback_.is_null()); | |
40 callback_.Run(response_); | |
41 callback_.Reset(); | |
42 response_.clear(); | |
43 } | |
OLD | NEW |