| 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 "base/tracked.h" | 5 #include "base/tracked.h" |
| 6 #include "chrome/browser/sync/engine/verify_updates_command.h" | 6 #include "chrome/browser/sync/engine/verify_updates_command.h" |
| 7 #include "chrome/browser/sync/protocol/bookmark_specifics.pb.h" | 7 #include "chrome/browser/sync/protocol/bookmark_specifics.pb.h" |
| 8 #include "chrome/browser/sync/sessions/sync_session.h" | 8 #include "chrome/browser/sync/sessions/sync_session.h" |
| 9 #include "chrome/browser/sync/syncable/directory_manager.h" | 9 #include "chrome/browser/sync/syncable/directory_manager.h" |
| 10 #include "chrome/browser/sync/engine/mock_model_safe_workers.h" | 10 #include "chrome/browser/sync/engine/mock_model_safe_workers.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 e->set_non_unique_name("b1"); | 67 e->set_non_unique_name("b1"); |
| 68 e->set_name("b1"); | 68 e->set_name("b1"); |
| 69 AddDefaultExtensionValue(type, e->mutable_specifics()); | 69 AddDefaultExtensionValue(type, e->mutable_specifics()); |
| 70 } | 70 } |
| 71 | 71 |
| 72 VerifyUpdatesCommand command_; | 72 VerifyUpdatesCommand command_; |
| 73 | 73 |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 TEST_F(VerifyUpdatesCommandTest, AllVerified) { | 76 TEST_F(VerifyUpdatesCommandTest, AllVerified) { |
| 77 string root = syncable::kNullId.GetServerId(); | 77 string root = syncable::GetNullId().GetServerId(); |
| 78 | 78 |
| 79 CreateLocalItem("b1", root, syncable::BOOKMARKS); | 79 CreateLocalItem("b1", root, syncable::BOOKMARKS); |
| 80 CreateLocalItem("b2", root, syncable::BOOKMARKS); | 80 CreateLocalItem("b2", root, syncable::BOOKMARKS); |
| 81 CreateLocalItem("p1", root, syncable::PREFERENCES); | 81 CreateLocalItem("p1", root, syncable::PREFERENCES); |
| 82 CreateLocalItem("a1", root, syncable::AUTOFILL); | 82 CreateLocalItem("a1", root, syncable::AUTOFILL); |
| 83 | 83 |
| 84 GetUpdatesResponse* updates = session()->status_controller()-> | 84 GetUpdatesResponse* updates = session()->status_controller()-> |
| 85 mutable_updates_response()->mutable_get_updates(); | 85 mutable_updates_response()->mutable_get_updates(); |
| 86 AddUpdate(updates, "b1", root, syncable::BOOKMARKS); | 86 AddUpdate(updates, "b1", root, syncable::BOOKMARKS); |
| 87 AddUpdate(updates, "b2", root, syncable::BOOKMARKS); | 87 AddUpdate(updates, "b2", root, syncable::BOOKMARKS); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 99 sessions::ScopedModelSafeGroupRestriction r(status, GROUP_DB); | 99 sessions::ScopedModelSafeGroupRestriction r(status, GROUP_DB); |
| 100 EXPECT_EQ(1, status->update_progress().VerifiedUpdatesSize()); | 100 EXPECT_EQ(1, status->update_progress().VerifiedUpdatesSize()); |
| 101 } | 101 } |
| 102 { | 102 { |
| 103 sessions::ScopedModelSafeGroupRestriction r(status, GROUP_PASSIVE); | 103 sessions::ScopedModelSafeGroupRestriction r(status, GROUP_PASSIVE); |
| 104 EXPECT_EQ(0, status->update_progress().VerifiedUpdatesSize()); | 104 EXPECT_EQ(0, status->update_progress().VerifiedUpdatesSize()); |
| 105 } | 105 } |
| 106 } | 106 } |
| 107 | 107 |
| 108 } | 108 } |
| OLD | NEW |