This source file includes following definitions.
- StartFetching
- DeleteFlashLSOsForSite
- AddFlashLSODomain
- Notify
- AllDeleted
#include "chrome/browser/browsing_data/mock_browsing_data_flash_lso_helper.h"
#include <algorithm>
#include "testing/gtest/include/gtest/gtest.h"
MockBrowsingDataFlashLSOHelper::MockBrowsingDataFlashLSOHelper(
content::BrowserContext* browser_context) {
}
void MockBrowsingDataFlashLSOHelper::StartFetching(
const GetSitesWithFlashDataCallback& callback) {
callback_ = callback;
}
void MockBrowsingDataFlashLSOHelper::DeleteFlashLSOsForSite(
const std::string& site) {
std::vector<std::string>::iterator entry =
std::find(domains_.begin(), domains_.end(), site);
ASSERT_TRUE(entry != domains_.end());
domains_.erase(entry);
}
void MockBrowsingDataFlashLSOHelper::AddFlashLSODomain(
const std::string& domain) {
domains_.push_back(domain);
}
void MockBrowsingDataFlashLSOHelper::Notify() {
callback_.Run(domains_);
callback_ = GetSitesWithFlashDataCallback();
}
bool MockBrowsingDataFlashLSOHelper::AllDeleted() {
return domains_.empty();
}
MockBrowsingDataFlashLSOHelper::~MockBrowsingDataFlashLSOHelper() {
}