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

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

Issue 23866012: Send configuration stats together at the end of data type configuration so that (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/download.h" 5 #include "sync/engine/download.h"
6 #include "sync/internal_api/public/base/model_type_test_util.h" 6 #include "sync/internal_api/public/base/model_type_test_util.h"
7 #include "sync/protocol/sync.pb.h" 7 #include "sync/protocol/sync.pb.h"
8 #include "sync/sessions/nudge_tracker.h" 8 #include "sync/sessions/nudge_tracker.h"
9 #include "sync/test/engine/fake_model_worker.h" 9 #include "sync/test/engine/fake_model_worker.h"
10 #include "sync/test/engine/syncer_command_test.h" 10 #include "sync/test/engine/syncer_command_test.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 BuildNormalDownloadUpdates(session1.get(), 137 BuildNormalDownloadUpdates(session1.get(),
138 false, 138 false,
139 GetRoutingInfoTypes(routing_info()), 139 GetRoutingInfoTypes(routing_info()),
140 nudge_tracker, 140 nudge_tracker,
141 &msg1); 141 &msg1);
142 EXPECT_EQ(0, msg1.debug_info().events_size()); 142 EXPECT_EQ(0, msg1.debug_info().events_size());
143 143
144 // Create a new session, record an event, and try again. 144 // Create a new session, record an event, and try again.
145 scoped_ptr<sessions::SyncSession> session2( 145 scoped_ptr<sessions::SyncSession> session2(
146 sessions::SyncSession::Build(context(), delegate())); 146 sessions::SyncSession::Build(context(), delegate()));
147 debug_info_event_listener()->OnConfigureComplete(); 147 DataTypeConfigurationStats stats;
148 stats.model_type = BOOKMARKS;
149 debug_info_event_listener()->OnDataTypeConfigureComplete(
150 std::vector<DataTypeConfigurationStats>(1, stats));
148 sync_pb::ClientToServerMessage msg2; 151 sync_pb::ClientToServerMessage msg2;
149 BuildNormalDownloadUpdates(session2.get(), 152 BuildNormalDownloadUpdates(session2.get(),
150 false, 153 false,
151 GetRoutingInfoTypes(routing_info()), 154 GetRoutingInfoTypes(routing_info()),
152 nudge_tracker, 155 nudge_tracker,
153 &msg2); 156 &msg2);
154 EXPECT_EQ(1, msg2.debug_info().events_size()); 157 EXPECT_EQ(1, msg2.debug_info().events_size());
155 158
156 // Events should never be sent up more than once per session. 159 // Events should never be sent up more than once per session.
157 sync_pb::ClientToServerMessage msg3; 160 sync_pb::ClientToServerMessage msg3;
158 BuildNormalDownloadUpdates(session2.get(), 161 BuildNormalDownloadUpdates(session2.get(),
159 false, 162 false,
160 GetRoutingInfoTypes(routing_info()), 163 GetRoutingInfoTypes(routing_info()),
161 nudge_tracker, 164 nudge_tracker,
162 &msg3); 165 &msg3);
163 EXPECT_EQ(0, msg3.debug_info().events_size()); 166 EXPECT_EQ(0, msg3.debug_info().events_size());
164 } 167 }
165 168
166 } // namespace syncer 169 } // namespace syncer
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_preference_unittest.cc ('k') | sync/internal_api/debug_info_event_listener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698