OLD | NEW |
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/sessions/sync_session.h" | 5 #include "sync/sessions/sync_session.h" |
6 #include "sync/test/engine/test_id_factory.h" | 6 #include "sync/test/engine/test_id_factory.h" |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 | 8 |
9 namespace syncer { | 9 namespace syncer { |
10 namespace sessions { | 10 namespace sessions { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 syncable::Id()); | 75 syncable::Id()); |
76 EXPECT_TRUE(status.update_progress()->HasConflictingUpdates()); | 76 EXPECT_TRUE(status.update_progress()->HasConflictingUpdates()); |
77 } | 77 } |
78 | 78 |
79 EXPECT_TRUE(status.HasConflictingUpdates()); | 79 EXPECT_TRUE(status.HasConflictingUpdates()); |
80 } | 80 } |
81 | 81 |
82 TEST_F(StatusControllerTest, CountUpdates) { | 82 TEST_F(StatusControllerTest, CountUpdates) { |
83 StatusController status(routes_); | 83 StatusController status(routes_); |
84 EXPECT_EQ(0, status.CountUpdates()); | 84 EXPECT_EQ(0, status.CountUpdates()); |
85 ClientToServerResponse* response(status.mutable_updates_response()); | 85 sync_pb::ClientToServerResponse* response(status.mutable_updates_response()); |
86 sync_pb::SyncEntity* entity1 = response->mutable_get_updates()->add_entries(); | 86 sync_pb::SyncEntity* entity1 = response->mutable_get_updates()->add_entries(); |
87 sync_pb::SyncEntity* entity2 = response->mutable_get_updates()->add_entries(); | 87 sync_pb::SyncEntity* entity2 = response->mutable_get_updates()->add_entries(); |
88 ASSERT_TRUE(entity1 != NULL && entity2 != NULL); | 88 ASSERT_TRUE(entity1 != NULL && entity2 != NULL); |
89 EXPECT_EQ(2, status.CountUpdates()); | 89 EXPECT_EQ(2, status.CountUpdates()); |
90 } | 90 } |
91 | 91 |
92 // Test TotalNumConflictingItems | 92 // Test TotalNumConflictingItems |
93 TEST_F(StatusControllerTest, TotalNumConflictingItems) { | 93 TEST_F(StatusControllerTest, TotalNumConflictingItems) { |
94 StatusController status(routes_); | 94 StatusController status(routes_); |
95 TestIdFactory f; | 95 TestIdFactory f; |
(...skipping 26 matching lines...) Expand all Loading... |
122 status.GetUnrestrictedUpdateProgress(GROUP_UI); | 122 status.GetUnrestrictedUpdateProgress(GROUP_UI); |
123 EXPECT_FALSE(progress); | 123 EXPECT_FALSE(progress); |
124 status.model_neutral_state(); | 124 status.model_neutral_state(); |
125 status.download_updates_succeeded(); | 125 status.download_updates_succeeded(); |
126 status.ServerSaysNothingMoreToDownload(); | 126 status.ServerSaysNothingMoreToDownload(); |
127 status.group_restriction(); | 127 status.group_restriction(); |
128 } | 128 } |
129 | 129 |
130 } // namespace sessions | 130 } // namespace sessions |
131 } // namespace syncer | 131 } // namespace syncer |
OLD | NEW |