OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 // Syncer unit tests. Unfortunately a lot of these tests | 5 // Syncer unit tests. Unfortunately a lot of these tests |
6 // are outdated and need to be reworked and updated. | 6 // are outdated and need to be reworked and updated. |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <limits> | 9 #include <limits> |
10 #include <list> | 10 #include <list> |
(...skipping 3231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3242 syncable::ReadTransaction rtrans(FROM_HERE, directory()); | 3242 syncable::ReadTransaction rtrans(FROM_HERE, directory()); |
3243 Entry good_entry(&rtrans, syncable::GET_BY_ID, ids_.FromNumber(1)); | 3243 Entry good_entry(&rtrans, syncable::GET_BY_ID, ids_.FromNumber(1)); |
3244 ASSERT_TRUE(good_entry.good()); | 3244 ASSERT_TRUE(good_entry.good()); |
3245 EXPECT_FALSE(good_entry.GetIsUnappliedUpdate()); | 3245 EXPECT_FALSE(good_entry.GetIsUnappliedUpdate()); |
3246 Entry bad_parent(&rtrans, syncable::GET_BY_ID, ids_.FromNumber(2)); | 3246 Entry bad_parent(&rtrans, syncable::GET_BY_ID, ids_.FromNumber(2)); |
3247 ASSERT_TRUE(bad_parent.good()); | 3247 ASSERT_TRUE(bad_parent.good()); |
3248 EXPECT_TRUE(bad_parent.GetIsUnappliedUpdate()); | 3248 EXPECT_TRUE(bad_parent.GetIsUnappliedUpdate()); |
3249 } | 3249 } |
3250 } | 3250 } |
3251 | 3251 |
3252 const char kRootId[] = "0"; | |
3253 | |
3254 TEST_F(SyncerTest, DirectoryUpdateTest) { | 3252 TEST_F(SyncerTest, DirectoryUpdateTest) { |
3255 Id in_root_id = ids_.NewServerId(); | 3253 Id in_root_id = ids_.NewServerId(); |
3256 Id in_in_root_id = ids_.NewServerId(); | 3254 Id in_in_root_id = ids_.NewServerId(); |
3257 | 3255 |
3258 mock_server_->AddUpdateDirectory(in_root_id, TestIdFactory::root(), | 3256 mock_server_->AddUpdateDirectory(in_root_id, TestIdFactory::root(), |
3259 "in_root_name", 2, 2, | 3257 "in_root_name", 2, 2, |
3260 foreign_cache_guid(), "-1"); | 3258 foreign_cache_guid(), "-1"); |
3261 mock_server_->AddUpdateDirectory(in_in_root_id, in_root_id, | 3259 mock_server_->AddUpdateDirectory(in_in_root_id, in_root_id, |
3262 "in_in_root_name", 3, 3, | 3260 "in_in_root_name", 3, 3, |
3263 foreign_cache_guid(), "-2"); | 3261 foreign_cache_guid(), "-2"); |
(...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4750 EXPECT_EQ("xyz", final_monitor_records["xyz"].extension_id); | 4748 EXPECT_EQ("xyz", final_monitor_records["xyz"].extension_id); |
4751 EXPECT_EQ(2049U, final_monitor_records["ABC"].bookmark_write_count); | 4749 EXPECT_EQ(2049U, final_monitor_records["ABC"].bookmark_write_count); |
4752 EXPECT_EQ(4U, final_monitor_records["xyz"].bookmark_write_count); | 4750 EXPECT_EQ(4U, final_monitor_records["xyz"].bookmark_write_count); |
4753 } else { | 4751 } else { |
4754 EXPECT_TRUE(final_monitor_records.empty()) | 4752 EXPECT_TRUE(final_monitor_records.empty()) |
4755 << "Should not restore records after successful bookmark commit."; | 4753 << "Should not restore records after successful bookmark commit."; |
4756 } | 4754 } |
4757 } | 4755 } |
4758 | 4756 |
4759 } // namespace syncer | 4757 } // namespace syncer |
OLD | NEW |