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

Side by Side Diff: chrome/browser/sync/test/integration/single_client_user_events_sync_test.cc

Issue 2969643002: Reland - Replace FakeServer's implementation with LoopbackServer invocations. (Closed)
Patch Set: Rebased on master. Created 3 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "base/macros.h" 5 #include "base/macros.h"
6 #include "base/time/time.h" 6 #include "base/time/time.h"
7 #include "chrome/browser/sync/test/integration/single_client_status_change_check er.h" 7 #include "chrome/browser/sync/test/integration/single_client_status_change_check er.h"
8 #include "chrome/browser/sync/test/integration/status_change_checker.h" 8 #include "chrome/browser/sync/test/integration/status_change_checker.h"
9 #include "chrome/browser/sync/test/integration/sync_test.h" 9 #include "chrome/browser/sync/test/integration/sync_test.h"
10 #include "chrome/browser/sync/user_event_service_factory.h" 10 #include "chrome/browser/sync/user_event_service_factory.h"
(...skipping 12 matching lines...) Expand all
23 UserEventSpecifics CreateEvent(int minutes_ago) { 23 UserEventSpecifics CreateEvent(int minutes_ago) {
24 UserEventSpecifics specifics; 24 UserEventSpecifics specifics;
25 specifics.set_event_time_usec( 25 specifics.set_event_time_usec(
26 (Time::Now() - TimeDelta::FromMinutes(minutes_ago)).ToInternalValue()); 26 (Time::Now() - TimeDelta::FromMinutes(minutes_ago)).ToInternalValue());
27 specifics.mutable_test_event(); 27 specifics.mutable_test_event();
28 return specifics; 28 return specifics;
29 } 29 }
30 30
31 CommitResponse::ResponseType BounceType( 31 CommitResponse::ResponseType BounceType(
32 CommitResponse::ResponseType type, 32 CommitResponse::ResponseType type,
33 const fake_server::FakeServerEntity& entity) { 33 const syncer::LoopbackServerEntity& entity) {
34 return type; 34 return type;
35 } 35 }
36 36
37 CommitResponse::ResponseType TransientErrorFirst( 37 CommitResponse::ResponseType TransientErrorFirst(
38 bool* first, 38 bool* first,
39 UserEventSpecifics* retry_specifics, 39 UserEventSpecifics* retry_specifics,
40 const fake_server::FakeServerEntity& entity) { 40 const syncer::LoopbackServerEntity& entity) {
41 if (*first) { 41 if (*first) {
42 *first = false; 42 *first = false;
43 SyncEntity sync_entity; 43 SyncEntity sync_entity;
44 entity.SerializeAsProto(&sync_entity); 44 entity.SerializeAsProto(&sync_entity);
45 *retry_specifics = sync_entity.specifics().user_event(); 45 *retry_specifics = sync_entity.specifics().user_event();
46 return CommitResponse::TRANSIENT_ERROR; 46 return CommitResponse::TRANSIENT_ERROR;
47 } else { 47 } else {
48 return CommitResponse::SUCCESS; 48 return CommitResponse::SUCCESS;
49 } 49 }
50 } 50 }
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 event_service->RecordUserEvent(specifics1); 179 event_service->RecordUserEvent(specifics1);
180 UserEventEqualityChecker(GetSyncService(0), GetFakeServer(), 180 UserEventEqualityChecker(GetSyncService(0), GetFakeServer(),
181 {specifics1, specifics2}) 181 {specifics1, specifics2})
182 .Wait(); 182 .Wait();
183 UserEventEqualityChecker(GetSyncService(0), GetFakeServer(), 183 UserEventEqualityChecker(GetSyncService(0), GetFakeServer(),
184 {specifics1, specifics2, retry_specifics}) 184 {specifics1, specifics2, retry_specifics})
185 .Wait(); 185 .Wait();
186 } 186 }
187 187
188 } // namespace 188 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698