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

Unified Diff: sync/engine/download_updates_command_unittest.cc

Issue 14963002: sync: Report GetUpdate triggers to the server (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix handling of NEW_CLIENT GU source Created 7 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
« no previous file with comments | « sync/engine/download_updates_command.cc ('k') | sync/engine/sync_scheduler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/download_updates_command_unittest.cc
diff --git a/sync/engine/download_updates_command_unittest.cc b/sync/engine/download_updates_command_unittest.cc
index 0b4d5c9e401f9bd0862b509f353cc841ebb0888b..77bc44754448ab0ca39549018dc30eff8abd8dd9 100644
--- a/sync/engine/download_updates_command_unittest.cc
+++ b/sync/engine/download_updates_command_unittest.cc
@@ -3,10 +3,8 @@
// found in the LICENSE file.
#include "sync/engine/download_updates_command.h"
-#include "sync/protocol/autofill_specifics.pb.h"
-#include "sync/protocol/bookmark_specifics.pb.h"
-#include "sync/protocol/preference_specifics.pb.h"
#include "sync/protocol/sync.pb.h"
+#include "sync/sessions/nudge_tracker.h"
#include "sync/test/engine/fake_model_worker.h"
#include "sync/test/engine/syncer_command_test.h"
@@ -41,21 +39,42 @@ class DownloadUpdatesCommandTest : public SyncerCommandTest {
TEST_F(DownloadUpdatesCommandTest, ExecuteNoStates) {
ConfigureMockServerConnection();
+
+ sessions::NudgeTracker nudge_tracker;
+ nudge_tracker.RecordLocalChange(ModelTypeSet(BOOKMARKS));
+
mock_server()->ExpectGetUpdatesRequestTypes(
GetRoutingInfoTypes(routing_info()));
- command_.ExecuteImpl(session());
+ command_.ExecuteImpl(
+ sessions::SyncSession::BuildForNudge(context(),
+ delegate(),
+ nudge_tracker.GetSourceInfo(),
+ &nudge_tracker));
}
TEST_F(DownloadUpdatesCommandTest, ExecuteWithStates) {
ConfigureMockServerConnection();
- sessions::SyncSourceInfo source;
- source.types[AUTOFILL].payload = "autofill_payload";
- source.types[BOOKMARKS].payload = "bookmark_payload";
- source.types[PREFERENCES].payload = "preferences_payload";
+
+ sessions::NudgeTracker nudge_tracker;
+ nudge_tracker.RecordRemoteInvalidation(
+ ModelTypeSetToInvalidationMap(ModelTypeSet(AUTOFILL),
+ "autofill_payload"));
+ nudge_tracker.RecordRemoteInvalidation(
+ ModelTypeSetToInvalidationMap(ModelTypeSet(BOOKMARKS),
+ "bookmark_payload"));
+ nudge_tracker.RecordRemoteInvalidation(
+ ModelTypeSetToInvalidationMap(ModelTypeSet(PREFERENCES),
+ "preferences_payload"));
+
mock_server()->ExpectGetUpdatesRequestTypes(
GetRoutingInfoTypes(routing_info()));
- mock_server()->ExpectGetUpdatesRequestStates(source.types);
- command_.ExecuteImpl(session(source));
+ mock_server()->ExpectGetUpdatesRequestStates(
+ nudge_tracker.GetSourceInfo().types);
+ command_.ExecuteImpl(
+ sessions::SyncSession::BuildForNudge(context(),
+ delegate(),
+ nudge_tracker.GetSourceInfo(),
+ &nudge_tracker));
}
TEST_F(DownloadUpdatesCommandTest, VerifyAppendDebugInfo) {
« no previous file with comments | « sync/engine/download_updates_command.cc ('k') | sync/engine/sync_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698