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_flash_lso_helper.h"
9 #include "testing/gtest/include/gtest/gtest.h"
11 MockBrowsingDataFlashLSOHelper::MockBrowsingDataFlashLSOHelper(
12 content::BrowserContext
* browser_context
) {
14 void MockBrowsingDataFlashLSOHelper::StartFetching(
15 const GetSitesWithFlashDataCallback
& callback
) {
19 void MockBrowsingDataFlashLSOHelper::DeleteFlashLSOsForSite(
20 const std::string
& site
) {
21 std::vector
<std::string
>::iterator entry
=
22 std::find(domains_
.begin(), domains_
.end(), site
);
23 ASSERT_TRUE(entry
!= domains_
.end());
24 domains_
.erase(entry
);
27 void MockBrowsingDataFlashLSOHelper::AddFlashLSODomain(
28 const std::string
& domain
) {
29 domains_
.push_back(domain
);
32 void MockBrowsingDataFlashLSOHelper::Notify() {
33 callback_
.Run(domains_
);
34 callback_
= GetSitesWithFlashDataCallback();
37 bool MockBrowsingDataFlashLSOHelper::AllDeleted() {
38 return domains_
.empty();
41 MockBrowsingDataFlashLSOHelper::~MockBrowsingDataFlashLSOHelper() {