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

Unified Diff: sync/engine/syncer_unittest.cc

Issue 10454105: sync: Refactor per-datatype throttling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments Created 8 years, 6 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 | « sync/engine/syncer_proto_util_unittest.cc ('k') | sync/engine/throttled_data_type_tracker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/syncer_unittest.cc
diff --git a/sync/engine/syncer_unittest.cc b/sync/engine/syncer_unittest.cc
index 1cd97533a1a76e69c6d59ce66788bb2339526328..cce69aad43e17ac4bae980448295d9cfec9c1771 100644
--- a/sync/engine/syncer_unittest.cc
+++ b/sync/engine/syncer_unittest.cc
@@ -32,6 +32,7 @@
#include "sync/engine/syncer_proto_util.h"
#include "sync/engine/syncer_util.h"
#include "sync/engine/syncproto.h"
+#include "sync/engine/throttled_data_type_tracker.h"
#include "sync/engine/traffic_recorder.h"
#include "sync/internal_api/public/engine/model_safe_worker.h"
#include "sync/internal_api/public/syncable/model_type.h"
@@ -232,11 +233,13 @@ class SyncerTest : public testing::Test,
GetModelSafeRoutingInfo(&routing_info);
GetWorkers(&workers);
+ throttled_data_type_tracker_.reset(new ThrottledDataTypeTracker(NULL));
+
context_.reset(
new SyncSessionContext(
mock_server_.get(), directory(), routing_info, workers,
- &extensions_activity_monitor_, listeners, NULL,
- &traffic_recorder_));
+ &extensions_activity_monitor_, throttled_data_type_tracker_.get(),
+ listeners, NULL, &traffic_recorder_));
ASSERT_FALSE(context_->resolver());
syncer_ = new Syncer();
session_.reset(MakeSession());
@@ -544,6 +547,7 @@ class SyncerTest : public testing::Test,
TestDirectorySetterUpper dir_maker_;
FakeEncryptor encryptor_;
FakeExtensionsActivityMonitor extensions_activity_monitor_;
+ scoped_ptr<ThrottledDataTypeTracker> throttled_data_type_tracker_;
scoped_ptr<MockConnectionManager> mock_server_;
Syncer* syncer_;
@@ -647,7 +651,7 @@ TEST_F(SyncerTest, GetCommitIdsFiltersThrottledEntries) {
}
// Now set the throttled types.
- context_->SetUnthrottleTime(
+ context_->throttled_data_type_tracker()->SetUnthrottleTime(
throttled_types,
base::TimeTicks::Now() + base::TimeDelta::FromSeconds(1200));
SyncShareNudge();
@@ -661,7 +665,7 @@ TEST_F(SyncerTest, GetCommitIdsFiltersThrottledEntries) {
}
// Now unthrottle.
- context_->SetUnthrottleTime(
+ context_->throttled_data_type_tracker()->SetUnthrottleTime(
throttled_types,
base::TimeTicks::Now() - base::TimeDelta::FromSeconds(1200));
SyncShareNudge();
« no previous file with comments | « sync/engine/syncer_proto_util_unittest.cc ('k') | sync/engine/throttled_data_type_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698