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

Unified Diff: sync/engine/sync_scheduler_whitebox_unittest.cc

Issue 10454105: sync: Refactor per-datatype throttling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleaned up and rebased Created 8 years, 7 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: sync/engine/sync_scheduler_whitebox_unittest.cc
diff --git a/sync/engine/sync_scheduler_whitebox_unittest.cc b/sync/engine/sync_scheduler_whitebox_unittest.cc
index 1b67a18d2d0b592031c143320a947d646e1fe505..afc778377715109074b2ff19356c90bf68dee83f 100644
--- a/sync/engine/sync_scheduler_whitebox_unittest.cc
+++ b/sync/engine/sync_scheduler_whitebox_unittest.cc
@@ -4,6 +4,7 @@
#include "base/message_loop.h"
#include "base/time.h"
+#include "sync/engine/throttled_data_type_tracker.h"
#include "sync/engine/sync_scheduler.h"
#include "sync/sessions/sync_session_context.h"
#include "sync/sessions/test_util.h"
@@ -38,6 +39,7 @@ class SyncSchedulerWhiteboxTest : public testing::Test {
new SyncSessionContext(
connection_.get(), dir_maker_.directory(),
registrar_.get(), &extensions_activity_monitor_,
+ &throttled_data_type_tracker_,
std::vector<SyncEngineEventListener*>(), NULL, NULL);
context_->set_notifications_enabled(true);
context_->set_account_name("Test");
@@ -109,6 +111,7 @@ class SyncSchedulerWhiteboxTest : public testing::Test {
SyncSessionContext* context_;
scoped_ptr<FakeModelSafeWorkerRegistrar> registrar_;
FakeExtensionsActivityMonitor extensions_activity_monitor_;
+ ThrottledDataTypeTracker throttled_data_type_tracker_;
TestDirectorySetterUpper dir_maker_;
};
@@ -131,8 +134,8 @@ TEST_F(SyncSchedulerWhiteboxTest, SaveNudgeWhileTypeThrottled) {
types.Put(syncable::BOOKMARKS);
// Mark bookmarks as throttled.
- context()->SetUnthrottleTime(types,
- base::TimeTicks::Now() + base::TimeDelta::FromHours(2));
+ context()->throttled_data_type_tracker()->SetUnthrottleTime(
+ types, base::TimeTicks::Now() + base::TimeDelta::FromHours(2));
syncable::ModelTypePayloadMap types_with_payload;
types_with_payload[syncable::BOOKMARKS] = "";

Powered by Google App Engine
This is Rietveld 408576698