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

Side by Side Diff: sync/sessions/sync_session_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 unified diff | Download patch
« no previous file with comments | « sync/sessions/sync_session.cc ('k') | sync/test/engine/fake_sync_scheduler.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/sessions/sync_session.h" 5 #include "sync/sessions/sync_session.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 15 matching lines...) Expand all
26 26
27 namespace sessions { 27 namespace sessions {
28 namespace { 28 namespace {
29 29
30 class SyncSessionTest : public testing::Test, 30 class SyncSessionTest : public testing::Test,
31 public SyncSession::Delegate { 31 public SyncSession::Delegate {
32 public: 32 public:
33 SyncSessionTest() : controller_invocations_allowed_(false) {} 33 SyncSessionTest() : controller_invocations_allowed_(false) {}
34 34
35 SyncSession* MakeSession() { 35 SyncSession* MakeSession() {
36 return new SyncSession(context_.get(), this, SyncSourceInfo()); 36 return SyncSession::Build(context_.get(),
37 this,
38 SyncSourceInfo());
37 } 39 }
38 40
39 virtual void SetUp() { 41 virtual void SetUp() {
40 routes_.clear(); 42 routes_.clear();
41 routes_[BOOKMARKS] = GROUP_UI; 43 routes_[BOOKMARKS] = GROUP_UI;
42 routes_[AUTOFILL] = GROUP_DB; 44 routes_[AUTOFILL] = GROUP_DB;
43 scoped_refptr<ModelSafeWorker> passive_worker( 45 scoped_refptr<ModelSafeWorker> passive_worker(
44 new FakeModelWorker(GROUP_PASSIVE)); 46 new FakeModelWorker(GROUP_PASSIVE));
45 scoped_refptr<ModelSafeWorker> ui_worker( 47 scoped_refptr<ModelSafeWorker> ui_worker(
46 new FakeModelWorker(GROUP_UI)); 48 new FakeModelWorker(GROUP_UI));
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 FailControllerInvocationIfDisabled("OnReceivedLongPollIntervalUpdate"); 90 FailControllerInvocationIfDisabled("OnReceivedLongPollIntervalUpdate");
89 } 91 }
90 virtual void OnReceivedShortPollIntervalUpdate( 92 virtual void OnReceivedShortPollIntervalUpdate(
91 const base::TimeDelta& new_interval) OVERRIDE { 93 const base::TimeDelta& new_interval) OVERRIDE {
92 FailControllerInvocationIfDisabled("OnReceivedShortPollIntervalUpdate"); 94 FailControllerInvocationIfDisabled("OnReceivedShortPollIntervalUpdate");
93 } 95 }
94 virtual void OnReceivedSessionsCommitDelay( 96 virtual void OnReceivedSessionsCommitDelay(
95 const base::TimeDelta& new_delay) OVERRIDE { 97 const base::TimeDelta& new_delay) OVERRIDE {
96 FailControllerInvocationIfDisabled("OnReceivedSessionsCommitDelay"); 98 FailControllerInvocationIfDisabled("OnReceivedSessionsCommitDelay");
97 } 99 }
100 virtual void OnReceivedClientInvalidationHintBufferSize(
101 int size) OVERRIDE {
102 FailControllerInvocationIfDisabled(
103 "OnReceivedClientInvalidationHintBufferSize");
104 }
98 virtual void OnShouldStopSyncingPermanently() OVERRIDE { 105 virtual void OnShouldStopSyncingPermanently() OVERRIDE {
99 FailControllerInvocationIfDisabled("OnShouldStopSyncingPermanently"); 106 FailControllerInvocationIfDisabled("OnShouldStopSyncingPermanently");
100 } 107 }
101 virtual void OnSyncProtocolError( 108 virtual void OnSyncProtocolError(
102 const sessions::SyncSessionSnapshot& snapshot) OVERRIDE { 109 const sessions::SyncSessionSnapshot& snapshot) OVERRIDE {
103 FailControllerInvocationIfDisabled("SyncProtocolError"); 110 FailControllerInvocationIfDisabled("SyncProtocolError");
104 } 111 }
105 112
106 void GetWorkers(std::vector<ModelSafeWorker*>* out) const { 113 void GetWorkers(std::vector<ModelSafeWorker*>* out) const {
107 out->clear(); 114 out->clear();
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 194
188 ASSERT_EQ(3U, invalidation_map.size()); 195 ASSERT_EQ(3U, invalidation_map.size());
189 EXPECT_EQ(invalidation_map[BOOKMARKS].payload, payload); 196 EXPECT_EQ(invalidation_map[BOOKMARKS].payload, payload);
190 EXPECT_EQ(invalidation_map[PASSWORDS].payload, payload); 197 EXPECT_EQ(invalidation_map[PASSWORDS].payload, payload);
191 EXPECT_EQ(invalidation_map[AUTOFILL].payload, payload); 198 EXPECT_EQ(invalidation_map[AUTOFILL].payload, payload);
192 } 199 }
193 200
194 } // namespace 201 } // namespace
195 } // namespace sessions 202 } // namespace sessions
196 } // namespace syncer 203 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/sessions/sync_session.cc ('k') | sync/test/engine/fake_sync_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698