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

Unified Diff: chrome/browser/android/data_usage/data_use_matcher_unittest.cc

Issue 2158913002: Make DataUseTabModel and DataUseMatcher more independent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor fix 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
Index: chrome/browser/android/data_usage/data_use_matcher_unittest.cc
diff --git a/chrome/browser/android/data_usage/data_use_matcher_unittest.cc b/chrome/browser/android/data_usage/data_use_matcher_unittest.cc
index aac25942d6499f06e68e92975ebd1d733fea0e0b..74589ca9ec634bfedca21c171fa5de4bad73dbc4 100644
--- a/chrome/browser/android/data_usage/data_use_matcher_unittest.cc
+++ b/chrome/browser/android/data_usage/data_use_matcher_unittest.cc
@@ -10,12 +10,15 @@
#include <string>
#include <vector>
+#include "base/bind.h"
+#include "base/bind_helpers.h"
#include "base/macros.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/test/histogram_tester.h"
#include "base/time/tick_clock.h"
#include "base/time/time.h"
+#include "chrome/browser/android/data_usage/data_use_tab_model.h"
#include "chrome/browser/android/data_usage/external_data_use_observer_bridge.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/test/test_browser_thread_bundle.h"
@@ -78,10 +81,14 @@ class DataUseMatcherTest : public testing::Test {
: thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP),
external_data_use_observer_bridge_(
new TestExternalDataUseObserverBridge()),
- data_use_matcher_(base::WeakPtr<DataUseTabModel>(),
- external_data_use_observer_bridge_.get(),
- base::TimeDelta::FromSeconds(
- kDefaultMatchingRuleExpirationDurationSeconds)) {}
+ data_use_matcher_(
+ base::Bind(&DataUseTabModel::OnTrackingLabelRemoved,
+ base::WeakPtr<DataUseTabModel>()),
+ base::Bind(
+ &ExternalDataUseObserverBridge::ShouldRegisterAsDataUseObserver,
+ base::Unretained(external_data_use_observer_bridge_.get())),
+ base::TimeDelta::FromSeconds(
+ kDefaultMatchingRuleExpirationDurationSeconds)) {}
DataUseMatcher* data_use_matcher() { return &data_use_matcher_; }
« no previous file with comments | « chrome/browser/android/data_usage/data_use_matcher.cc ('k') | chrome/browser/android/data_usage/data_use_tab_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698