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

Side by Side Diff: sync/engine/get_updates_processor_unittest.cc

Issue 215973007: [Sync] Add plumbing of context from client to server (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sync/engine/get_updates_processor.cc ('k') | sync/engine/non_blocking_type_processor_core.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sync/engine/get_updates_processor.h" 5 #include "sync/engine/get_updates_processor.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "sync/engine/get_updates_delegate.h" 9 #include "sync/engine/get_updates_delegate.h"
10 #include "sync/engine/update_handler.h" 10 #include "sync/engine/update_handler.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 } 46 }
47 47
48 void InitFakeUpdateResponse(sync_pb::GetUpdatesResponse* response) { 48 void InitFakeUpdateResponse(sync_pb::GetUpdatesResponse* response) {
49 ModelTypeSet types = enabled_types(); 49 ModelTypeSet types = enabled_types();
50 50
51 for (ModelTypeSet::Iterator it = types.First(); it.Good(); it.Inc()) { 51 for (ModelTypeSet::Iterator it = types.First(); it.Good(); it.Inc()) {
52 sync_pb::DataTypeProgressMarker* marker = 52 sync_pb::DataTypeProgressMarker* marker =
53 response->add_new_progress_marker(); 53 response->add_new_progress_marker();
54 marker->set_data_type_id(GetSpecificsFieldNumberFromModelType(it.Get())); 54 marker->set_data_type_id(GetSpecificsFieldNumberFromModelType(it.Get()));
55 marker->set_token("foobarbaz"); 55 marker->set_token("foobarbaz");
56 sync_pb::DataTypeContext* context = response->add_context_mutations();
57 context->set_data_type_id(GetSpecificsFieldNumberFromModelType(it.Get()));
58 context->set_version(1);
59 context->set_context("context");
56 } 60 }
57 61
58 response->set_changes_remaining(0); 62 response->set_changes_remaining(0);
59 } 63 }
60 64
61 const UpdateHandler* GetHandler(ModelType type) { 65 const UpdateHandler* GetHandler(ModelType type) {
62 UpdateHandlerMap::iterator it = update_handler_map_.find(type); 66 UpdateHandlerMap::iterator it = update_handler_map_.find(type);
63 if (it == update_handler_map_.end()) 67 if (it == update_handler_map_.end())
64 return NULL; 68 return NULL;
65 return it->second; 69 return it->second;
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 TEST_F(DownloadUpdatesDebugInfoTest, VerifyCopyOverwrites) { 455 TEST_F(DownloadUpdatesDebugInfoTest, VerifyCopyOverwrites) {
452 sync_pb::DebugInfo debug_info; 456 sync_pb::DebugInfo debug_info;
453 AddDebugEvent(); 457 AddDebugEvent();
454 GetUpdatesProcessor::CopyClientDebugInfo(debug_info_getter(), &debug_info); 458 GetUpdatesProcessor::CopyClientDebugInfo(debug_info_getter(), &debug_info);
455 EXPECT_EQ(1, debug_info.events_size()); 459 EXPECT_EQ(1, debug_info.events_size());
456 GetUpdatesProcessor::CopyClientDebugInfo(debug_info_getter(), &debug_info); 460 GetUpdatesProcessor::CopyClientDebugInfo(debug_info_getter(), &debug_info);
457 EXPECT_EQ(1, debug_info.events_size()); 461 EXPECT_EQ(1, debug_info.events_size());
458 } 462 }
459 463
460 } // namespace syncer 464 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/engine/get_updates_processor.cc ('k') | sync/engine/non_blocking_type_processor_core.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698