| OLD | NEW |
| 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 sessions::NudgeTracker nudge_tracker; | 208 sessions::NudgeTracker nudge_tracker; |
| 209 | 209 |
| 210 // Schedule a retry. | 210 // Schedule a retry. |
| 211 base::TimeTicks t1 = kTestStartTime; | 211 base::TimeTicks t1 = kTestStartTime; |
| 212 nudge_tracker.SetNextRetryTime(t1); | 212 nudge_tracker.SetNextRetryTime(t1); |
| 213 | 213 |
| 214 // Get the nudge tracker to think the retry is due. | 214 // Get the nudge tracker to think the retry is due. |
| 215 nudge_tracker.SetSyncCycleStartTime(t1 + base::TimeDelta::FromSeconds(1)); | 215 nudge_tracker.SetSyncCycleStartTime(t1 + base::TimeDelta::FromSeconds(1)); |
| 216 | 216 |
| 217 sync_pb::ClientToServerMessage message; | 217 sync_pb::ClientToServerMessage message; |
| 218 RetryGetUpdatesDelegate retry_delegate; | 218 NormalGetUpdatesDelegate normal_delegate(nudge_tracker); |
| 219 scoped_ptr<GetUpdatesProcessor> processor( | 219 scoped_ptr<GetUpdatesProcessor> processor( |
| 220 BuildGetUpdatesProcessor(retry_delegate)); | 220 BuildGetUpdatesProcessor(normal_delegate)); |
| 221 processor->PrepareGetUpdates(request_types(), &message); | 221 processor->PrepareGetUpdates(request_types(), &message); |
| 222 | 222 |
| 223 const sync_pb::GetUpdatesMessage& gu_msg = message.get_updates(); | 223 const sync_pb::GetUpdatesMessage& gu_msg = message.get_updates(); |
| 224 EXPECT_EQ(sync_pb::SyncEnums::RETRY, gu_msg.get_updates_origin()); | 224 EXPECT_EQ(sync_pb::SyncEnums::RETRY, gu_msg.get_updates_origin()); |
| 225 EXPECT_EQ(sync_pb::GetUpdatesCallerInfo::RETRY, | 225 EXPECT_EQ(sync_pb::GetUpdatesCallerInfo::RETRY, |
| 226 gu_msg.caller_info().source()); | 226 gu_msg.caller_info().source()); |
| 227 EXPECT_TRUE(gu_msg.is_retry()); | 227 EXPECT_TRUE(gu_msg.is_retry()); |
| 228 | 228 |
| 229 ModelTypeSet progress_types; | 229 ModelTypeSet progress_types; |
| 230 for (int i = 0; i < gu_msg.from_progress_marker_size(); ++i) { | 230 for (int i = 0; i < gu_msg.from_progress_marker_size(); ++i) { |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 TEST_F(DownloadUpdatesDebugInfoTest, VerifyCopyOverwrites) { | 349 TEST_F(DownloadUpdatesDebugInfoTest, VerifyCopyOverwrites) { |
| 350 sync_pb::DebugInfo debug_info; | 350 sync_pb::DebugInfo debug_info; |
| 351 AddDebugEvent(); | 351 AddDebugEvent(); |
| 352 GetUpdatesProcessor::CopyClientDebugInfo(debug_info_getter(), &debug_info); | 352 GetUpdatesProcessor::CopyClientDebugInfo(debug_info_getter(), &debug_info); |
| 353 EXPECT_EQ(1, debug_info.events_size()); | 353 EXPECT_EQ(1, debug_info.events_size()); |
| 354 GetUpdatesProcessor::CopyClientDebugInfo(debug_info_getter(), &debug_info); | 354 GetUpdatesProcessor::CopyClientDebugInfo(debug_info_getter(), &debug_info); |
| 355 EXPECT_EQ(1, debug_info.events_size()); | 355 EXPECT_EQ(1, debug_info.events_size()); |
| 356 } | 356 } |
| 357 | 357 |
| 358 } // namespace syncer | 358 } // namespace syncer |
| OLD | NEW |