Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1144)

Unified Diff: chrome/browser/extensions/api/browsing_data/browsing_data_test.cc

Issue 2171383002: Deprecate the CallbackSubscription in BrowsingDataRemover (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initialize masks to -1 Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_remover_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/browsing_data/browsing_data_test.cc
diff --git a/chrome/browser/extensions/api/browsing_data/browsing_data_test.cc b/chrome/browser/extensions/api/browsing_data/browsing_data_test.cc
index 3db0c9b67758708dee0a610f6e514c8edaace88e..62e150b8421e9157913056badd826b37eb04b78d 100644
--- a/chrome/browser/extensions/api/browsing_data/browsing_data_test.cc
+++ b/chrome/browser/extensions/api/browsing_data/browsing_data_test.cc
@@ -46,34 +46,22 @@ const char kRemoveEverythingArguments[] =
class ExtensionBrowsingDataTest : public InProcessBrowserTest {
public:
- base::Time GetBeginTime() {
- return called_with_details_->removal_begin;
+ const base::Time& GetBeginTime() {
+ return remover_->GetLastUsedBeginTime();
}
int GetRemovalMask() {
- return called_with_details_->removal_mask;
+ return remover_->GetLastUsedRemovalMask();
}
int GetOriginTypeMask() {
- return called_with_details_->origin_type_mask;
+ return remover_->GetLastUsedOriginTypeMask();
}
protected:
void SetUpOnMainThread() override {
- called_with_details_.reset(new BrowsingDataRemover::NotificationDetails());
- callback_subscription_ =
- BrowsingDataRemover::RegisterOnBrowsingDataRemovedCallback(
- base::Bind(&ExtensionBrowsingDataTest::NotifyWithDetails,
- base::Unretained(this)));
- }
-
- // Callback for browsing data removal events.
- void NotifyWithDetails(
- const BrowsingDataRemover::NotificationDetails& details) {
- // We're not taking ownership of the details object, but storing a copy of
- // it locally.
- called_with_details_.reset(
- new BrowsingDataRemover::NotificationDetails(details));
+ remover_ =
+ BrowsingDataRemoverFactory::GetForBrowserContext(browser()->profile());
}
int GetAsMask(const base::DictionaryValue* dict, std::string path,
@@ -256,10 +244,8 @@ class ExtensionBrowsingDataTest : public InProcessBrowserTest {
}
private:
- std::unique_ptr<BrowsingDataRemover::NotificationDetails>
- called_with_details_;
-
- BrowsingDataRemover::CallbackSubscription callback_subscription_;
+ // Cached pointer to BrowsingDataRemover for access to testing methods.
+ BrowsingDataRemover* remover_;
};
} // namespace
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_remover_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698