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" |
11 #include "sync/internal_api/public/base/model_type_test_util.h" | 11 #include "sync/internal_api/public/base/model_type_test_util.h" |
12 #include "sync/protocol/sync.pb.h" | 12 #include "sync/protocol/sync.pb.h" |
13 #include "sync/sessions/debug_info_getter.h" | 13 #include "sync/sessions/debug_info_getter.h" |
14 #include "sync/sessions/nudge_tracker.h" | 14 #include "sync/sessions/nudge_tracker.h" |
15 #include "sync/sessions/status_controller.h" | 15 #include "sync/sessions/status_controller.h" |
16 #include "sync/test/engine/fake_model_worker.h" | 16 #include "sync/test/engine/fake_model_worker.h" |
17 #include "sync/test/engine/mock_update_handler.h" | 17 #include "sync/test/engine/mock_update_handler.h" |
18 #include "sync/test/mock_invalidation.h" | 18 #include "sync/test/mock_invalidation.h" |
19 #include "sync/test/sessions/mock_debug_info_getter.h" | 19 #include "sync/test/sessions/mock_debug_info_getter.h" |
20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
21 | 21 |
22 namespace syncer { | 22 namespace syncer { |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 scoped_ptr<InvalidationInterface> BuildInvalidation( | 26 scoped_ptr<InvalidationInterface> BuildInvalidation( |
27 int64 version, | 27 int64 version, |
28 const std::string& payload) { | 28 const std::string& payload) { |
29 return MockInvalidation::Build(version, payload) | 29 return MockInvalidation::Build(version, payload); |
30 .PassAs<InvalidationInterface>(); | |
31 } | 30 } |
32 | 31 |
33 } // namespace | 32 } // namespace |
34 | 33 |
35 using sessions::MockDebugInfoGetter; | 34 using sessions::MockDebugInfoGetter; |
36 | 35 |
37 // A test fixture for tests exercising download updates functions. | 36 // A test fixture for tests exercising download updates functions. |
38 class GetUpdatesProcessorTest : public ::testing::Test { | 37 class GetUpdatesProcessorTest : public ::testing::Test { |
39 protected: | 38 protected: |
40 GetUpdatesProcessorTest() : | 39 GetUpdatesProcessorTest() : |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 TEST_F(DownloadUpdatesDebugInfoTest, VerifyCopyOverwrites) { | 504 TEST_F(DownloadUpdatesDebugInfoTest, VerifyCopyOverwrites) { |
506 sync_pb::DebugInfo debug_info; | 505 sync_pb::DebugInfo debug_info; |
507 AddDebugEvent(); | 506 AddDebugEvent(); |
508 GetUpdatesProcessor::CopyClientDebugInfo(debug_info_getter(), &debug_info); | 507 GetUpdatesProcessor::CopyClientDebugInfo(debug_info_getter(), &debug_info); |
509 EXPECT_EQ(1, debug_info.events_size()); | 508 EXPECT_EQ(1, debug_info.events_size()); |
510 GetUpdatesProcessor::CopyClientDebugInfo(debug_info_getter(), &debug_info); | 509 GetUpdatesProcessor::CopyClientDebugInfo(debug_info_getter(), &debug_info); |
511 EXPECT_EQ(1, debug_info.events_size()); | 510 EXPECT_EQ(1, debug_info.events_size()); |
512 } | 511 } |
513 | 512 |
514 } // namespace syncer | 513 } // namespace syncer |
OLD | NEW |