| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser/sync/test/engine/test_id_factory.h" | 6 #include "chrome/browser/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 browser_sync { | 9 namespace browser_sync { |
| 10 namespace sessions { | 10 namespace sessions { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 EXPECT_FALSE(status.TestAndClearIsDirty()); | 48 EXPECT_FALSE(status.TestAndClearIsDirty()); |
| 49 | 49 |
| 50 status.set_num_server_changes_remaining(30); | 50 status.set_num_server_changes_remaining(30); |
| 51 EXPECT_TRUE(status.TestAndClearIsDirty()); | 51 EXPECT_TRUE(status.TestAndClearIsDirty()); |
| 52 | 52 |
| 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); | |
| 59 EXPECT_TRUE(status.TestAndClearIsDirty()); | |
| 60 status.set_syncer_stuck(false); | |
| 61 EXPECT_TRUE(status.TestAndClearIsDirty()); | |
| 62 | |
| 63 status.increment_num_successful_commits(); | 58 status.increment_num_successful_commits(); |
| 64 EXPECT_TRUE(status.TestAndClearIsDirty()); | 59 EXPECT_TRUE(status.TestAndClearIsDirty()); |
| 65 status.increment_num_successful_commits(); | 60 status.increment_num_successful_commits(); |
| 66 EXPECT_TRUE(status.TestAndClearIsDirty()); | 61 EXPECT_TRUE(status.TestAndClearIsDirty()); |
| 67 | 62 |
| 68 { | 63 { |
| 69 ScopedModelSafeGroupRestriction r(&status, GROUP_UI); | 64 ScopedModelSafeGroupRestriction r(&status, GROUP_UI); |
| 70 status.mutable_conflict_progress()->AddConflictingItemById(syncable::Id()); | 65 status.mutable_conflict_progress()->AddConflictingItemById(syncable::Id()); |
| 71 } | 66 } |
| 72 EXPECT_TRUE(status.TestAndClearIsDirty()); | 67 EXPECT_TRUE(status.TestAndClearIsDirty()); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 status.increment_num_consecutive_errors_by(2); | 114 status.increment_num_consecutive_errors_by(2); |
| 120 EXPECT_EQ(11, status.error().consecutive_errors); | 115 EXPECT_EQ(11, status.error().consecutive_errors); |
| 121 | 116 |
| 122 status.set_num_server_changes_remaining(13); | 117 status.set_num_server_changes_remaining(13); |
| 123 EXPECT_EQ(13, status.num_server_changes_remaining()); | 118 EXPECT_EQ(13, status.num_server_changes_remaining()); |
| 124 | 119 |
| 125 EXPECT_FALSE(status.syncer_status().invalid_store); | 120 EXPECT_FALSE(status.syncer_status().invalid_store); |
| 126 status.set_invalid_store(true); | 121 status.set_invalid_store(true); |
| 127 EXPECT_TRUE(status.syncer_status().invalid_store); | 122 EXPECT_TRUE(status.syncer_status().invalid_store); |
| 128 | 123 |
| 129 EXPECT_FALSE(status.syncer_status().syncer_stuck); | |
| 130 status.set_syncer_stuck(true); | |
| 131 EXPECT_TRUE(status.syncer_status().syncer_stuck); | |
| 132 | |
| 133 for (int i = 0; i < 14; i++) | 124 for (int i = 0; i < 14; i++) |
| 134 status.increment_num_successful_commits(); | 125 status.increment_num_successful_commits(); |
| 135 EXPECT_EQ(14, status.syncer_status().num_successful_commits); | 126 EXPECT_EQ(14, status.syncer_status().num_successful_commits); |
| 136 | 127 |
| 137 std::vector<int64> v; | 128 std::vector<int64> v; |
| 138 v.push_back(16); | 129 v.push_back(16); |
| 139 status.set_unsynced_handles(v); | 130 status.set_unsynced_handles(v); |
| 140 EXPECT_EQ(16, v[0]); | 131 EXPECT_EQ(16, v[0]); |
| 141 } | 132 } |
| 142 | 133 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 status.num_server_changes_remaining(); | 200 status.num_server_changes_remaining(); |
| 210 status.commit_ids(); | 201 status.commit_ids(); |
| 211 status.HasBookmarkCommitActivity(); | 202 status.HasBookmarkCommitActivity(); |
| 212 status.download_updates_succeeded(); | 203 status.download_updates_succeeded(); |
| 213 status.ServerSaysNothingMoreToDownload(); | 204 status.ServerSaysNothingMoreToDownload(); |
| 214 status.group_restriction(); | 205 status.group_restriction(); |
| 215 } | 206 } |
| 216 | 207 |
| 217 } // namespace sessions | 208 } // namespace sessions |
| 218 } // namespace browser_sync | 209 } // namespace browser_sync |
| OLD | NEW |