| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/sync/sessions/sync_session.h" | 5 #include "chrome/browser/sync/sessions/sync_session.h" |
| 6 #include "chrome/test/sync/engine/test_id_factory.h" | 6 #include "chrome/test/sync/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 browser_sync { | 9 namespace browser_sync { |
| 10 namespace sessions { | 10 namespace sessions { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 status.set_invalid_store(true); | 53 status.set_invalid_store(true); |
| 54 EXPECT_TRUE(status.TestAndClearIsDirty()); | 54 EXPECT_TRUE(status.TestAndClearIsDirty()); |
| 55 status.set_invalid_store(false); | 55 status.set_invalid_store(false); |
| 56 EXPECT_TRUE(status.TestAndClearIsDirty()); | 56 EXPECT_TRUE(status.TestAndClearIsDirty()); |
| 57 | 57 |
| 58 status.set_syncer_stuck(true); | 58 status.set_syncer_stuck(true); |
| 59 EXPECT_TRUE(status.TestAndClearIsDirty()); | 59 EXPECT_TRUE(status.TestAndClearIsDirty()); |
| 60 status.set_syncer_stuck(false); | 60 status.set_syncer_stuck(false); |
| 61 EXPECT_TRUE(status.TestAndClearIsDirty()); | 61 EXPECT_TRUE(status.TestAndClearIsDirty()); |
| 62 | 62 |
| 63 status.set_syncing(true); | 63 status.SetSyncInProgressAndUpdateStartTime(true); |
| 64 EXPECT_TRUE(status.TestAndClearIsDirty()); | 64 EXPECT_TRUE(status.TestAndClearIsDirty()); |
| 65 status.set_syncing(false); | 65 status.SetSyncInProgressAndUpdateStartTime(false); |
| 66 EXPECT_TRUE(status.TestAndClearIsDirty()); | 66 EXPECT_TRUE(status.TestAndClearIsDirty()); |
| 67 | 67 |
| 68 status.increment_num_successful_commits(); | 68 status.increment_num_successful_commits(); |
| 69 EXPECT_TRUE(status.TestAndClearIsDirty()); | 69 EXPECT_TRUE(status.TestAndClearIsDirty()); |
| 70 status.increment_num_successful_commits(); | 70 status.increment_num_successful_commits(); |
| 71 EXPECT_TRUE(status.TestAndClearIsDirty()); | 71 EXPECT_TRUE(status.TestAndClearIsDirty()); |
| 72 | 72 |
| 73 { | 73 { |
| 74 ScopedModelSafeGroupRestriction r(&status, GROUP_UI); | 74 ScopedModelSafeGroupRestriction r(&status, GROUP_UI); |
| 75 status.mutable_conflict_progress()->AddConflictingItemById(syncable::Id()); | 75 status.mutable_conflict_progress()->AddConflictingItemById(syncable::Id()); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 EXPECT_EQ(13, status.num_server_changes_remaining()); | 128 EXPECT_EQ(13, status.num_server_changes_remaining()); |
| 129 | 129 |
| 130 EXPECT_FALSE(status.syncer_status().invalid_store); | 130 EXPECT_FALSE(status.syncer_status().invalid_store); |
| 131 status.set_invalid_store(true); | 131 status.set_invalid_store(true); |
| 132 EXPECT_TRUE(status.syncer_status().invalid_store); | 132 EXPECT_TRUE(status.syncer_status().invalid_store); |
| 133 | 133 |
| 134 EXPECT_FALSE(status.syncer_status().syncer_stuck); | 134 EXPECT_FALSE(status.syncer_status().syncer_stuck); |
| 135 status.set_syncer_stuck(true); | 135 status.set_syncer_stuck(true); |
| 136 EXPECT_TRUE(status.syncer_status().syncer_stuck); | 136 EXPECT_TRUE(status.syncer_status().syncer_stuck); |
| 137 | 137 |
| 138 EXPECT_FALSE(status.syncer_status().syncing); | 138 EXPECT_FALSE(status.syncer_status().sync_in_progress); |
| 139 status.set_syncing(true); | 139 status.SetSyncInProgressAndUpdateStartTime(true); |
| 140 EXPECT_TRUE(status.syncer_status().syncing); | 140 EXPECT_TRUE(status.syncer_status().sync_in_progress); |
| 141 | 141 |
| 142 for (int i = 0; i < 14; i++) | 142 for (int i = 0; i < 14; i++) |
| 143 status.increment_num_successful_commits(); | 143 status.increment_num_successful_commits(); |
| 144 EXPECT_EQ(14, status.syncer_status().num_successful_commits); | 144 EXPECT_EQ(14, status.syncer_status().num_successful_commits); |
| 145 | 145 |
| 146 std::vector<int64> v; | 146 std::vector<int64> v; |
| 147 v.push_back(16); | 147 v.push_back(16); |
| 148 status.set_unsynced_handles(v); | 148 status.set_unsynced_handles(v); |
| 149 EXPECT_EQ(16, v[0]); | 149 EXPECT_EQ(16, v[0]); |
| 150 } | 150 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 status.num_server_changes_remaining(); | 216 status.num_server_changes_remaining(); |
| 217 status.commit_ids(); | 217 status.commit_ids(); |
| 218 status.HasBookmarkCommitActivity(); | 218 status.HasBookmarkCommitActivity(); |
| 219 status.download_updates_succeeded(); | 219 status.download_updates_succeeded(); |
| 220 status.ServerSaysNothingMoreToDownload(); | 220 status.ServerSaysNothingMoreToDownload(); |
| 221 status.group_restriction(); | 221 status.group_restriction(); |
| 222 } | 222 } |
| 223 | 223 |
| 224 } // namespace sessions | 224 } // namespace sessions |
| 225 } // namespace browser_sync | 225 } // namespace browser_sync |
| OLD | NEW |