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

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

Issue 10696087: [Sync] Move ModelType and related classes to 'syncer' namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sort headers, update copyrights Created 8 years, 5 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/syncer_proto_util.cc ('k') | sync/engine/syncer_unittest.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/syncer_proto_util.h" 5 #include "sync/engine/syncer_proto_util.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 258
259 dcm.set_access_denied(true); 259 dcm.set_access_denied(true);
260 EXPECT_FALSE(SyncerProtoUtil::PostAndProcessHeaders(&dcm, NULL, 260 EXPECT_FALSE(SyncerProtoUtil::PostAndProcessHeaders(&dcm, NULL,
261 msg, &response)); 261 msg, &response));
262 } 262 }
263 263
264 TEST_F(SyncerProtoUtilTest, HandleThrottlingWithDatatypes) { 264 TEST_F(SyncerProtoUtilTest, HandleThrottlingWithDatatypes) {
265 ThrottledDataTypeTracker tracker(NULL); 265 ThrottledDataTypeTracker tracker(NULL);
266 SyncProtocolError error; 266 SyncProtocolError error;
267 error.error_type = syncer::THROTTLED; 267 error.error_type = syncer::THROTTLED;
268 syncable::ModelTypeSet types; 268 syncer::ModelTypeSet types;
269 types.Put(syncable::BOOKMARKS); 269 types.Put(syncer::BOOKMARKS);
270 types.Put(syncable::PASSWORDS); 270 types.Put(syncer::PASSWORDS);
271 error.error_data_types = types; 271 error.error_data_types = types;
272 272
273 base::TimeTicks ticks = base::TimeTicks::FromInternalValue(1); 273 base::TimeTicks ticks = base::TimeTicks::FromInternalValue(1);
274 SyncerProtoUtil::HandleThrottleError(error, ticks, &tracker, NULL); 274 SyncerProtoUtil::HandleThrottleError(error, ticks, &tracker, NULL);
275 EXPECT_TRUE(tracker.GetThrottledTypes().Equals(types)); 275 EXPECT_TRUE(tracker.GetThrottledTypes().Equals(types));
276 } 276 }
277 277
278 TEST_F(SyncerProtoUtilTest, HandleThrottlingNoDatatypes) { 278 TEST_F(SyncerProtoUtilTest, HandleThrottlingNoDatatypes) {
279 ThrottledDataTypeTracker tracker(NULL); 279 ThrottledDataTypeTracker tracker(NULL);
280 MockDelegate delegate; 280 MockDelegate delegate;
281 SyncProtocolError error; 281 SyncProtocolError error;
282 error.error_type = syncer::THROTTLED; 282 error.error_type = syncer::THROTTLED;
283 283
284 base::TimeTicks ticks = base::TimeTicks::FromInternalValue(1); 284 base::TimeTicks ticks = base::TimeTicks::FromInternalValue(1);
285 285
286 EXPECT_CALL(delegate, OnSilencedUntil(ticks)); 286 EXPECT_CALL(delegate, OnSilencedUntil(ticks));
287 287
288 SyncerProtoUtil::HandleThrottleError(error, ticks, &tracker, &delegate); 288 SyncerProtoUtil::HandleThrottleError(error, ticks, &tracker, &delegate);
289 EXPECT_TRUE(tracker.GetThrottledTypes().Empty()); 289 EXPECT_TRUE(tracker.GetThrottledTypes().Empty());
290 } 290 }
291 } // namespace syncer 291 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/engine/syncer_proto_util.cc ('k') | sync/engine/syncer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698