Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / chrome / browser / browsing_data / mock_browsing_data_quota_helper.cc
blobfc5d7d6465aabb5e51ac21e9b83932977cbeb8b7
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.
5 #include "chrome/browser/browsing_data/mock_browsing_data_quota_helper.h"
7 #include "content/public/browser/browser_thread.h"
8 #include "testing/gtest/include/gtest/gtest.h"
10 using content::BrowserThread;
12 MockBrowsingDataQuotaHelper::MockBrowsingDataQuotaHelper(Profile* profile)
13 : BrowsingDataQuotaHelper() {}
15 MockBrowsingDataQuotaHelper::~MockBrowsingDataQuotaHelper() {}
17 void MockBrowsingDataQuotaHelper::StartFetching(
18 const FetchResultCallback& callback) {
19 ASSERT_FALSE(callback.is_null());
20 ASSERT_TRUE(callback_.is_null());
21 callback_ = callback;
24 void MockBrowsingDataQuotaHelper::RevokeHostQuota(const std::string& host) {
27 void MockBrowsingDataQuotaHelper::AddHost(
28 const std::string& host,
29 int64 temporary_usage,
30 int64 persistent_usage,
31 int64 syncable_usage) {
32 response_.push_back(QuotaInfo(
33 host,
34 temporary_usage,
35 persistent_usage,
36 syncable_usage));
39 void MockBrowsingDataQuotaHelper::AddQuotaSamples() {
40 AddHost("quotahost1", 1, 2, 1);
41 AddHost("quotahost2", 10, 20, 10);
44 void MockBrowsingDataQuotaHelper::Notify() {
45 callback_.Run(response_);
46 callback_.Reset();
47 response_.clear();