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 "chrome/browser/sync/api/sync_change.h" | 5 #include "chrome/browser/sync/api/sync_change.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "chrome/browser/sync/protocol/proto_value_conversions.h" | |
12 #include "sync/protocol/preference_specifics.pb.h" | 11 #include "sync/protocol/preference_specifics.pb.h" |
| 12 #include "sync/protocol/proto_value_conversions.h" |
13 #include "sync/protocol/sync.pb.h" | 13 #include "sync/protocol/sync.pb.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 | 15 |
16 using browser_sync::EntitySpecificsToValue; | 16 using browser_sync::EntitySpecificsToValue; |
17 | 17 |
18 // Ordered list of SyncChange's. | 18 // Ordered list of SyncChange's. |
19 typedef std::vector<SyncChange> SyncChangeList; | 19 typedef std::vector<SyncChange> SyncChangeList; |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 // Verify delete. | 121 // Verify delete. |
122 e = change_list[2]; | 122 e = change_list[2]; |
123 EXPECT_EQ(SyncChange::ACTION_DELETE, e.change_type()); | 123 EXPECT_EQ(SyncChange::ACTION_DELETE, e.change_type()); |
124 EXPECT_EQ(syncable::PREFERENCES, e.sync_data().GetDataType()); | 124 EXPECT_EQ(syncable::PREFERENCES, e.sync_data().GetDataType()); |
125 ref_spec.reset(EntitySpecificsToValue(delete_specifics)); | 125 ref_spec.reset(EntitySpecificsToValue(delete_specifics)); |
126 e_spec.reset(EntitySpecificsToValue(e.sync_data().GetSpecifics())); | 126 e_spec.reset(EntitySpecificsToValue(e.sync_data().GetSpecifics())); |
127 EXPECT_TRUE(ref_spec->Equals(e_spec.get())); | 127 EXPECT_TRUE(ref_spec->Equals(e_spec.get())); |
128 } | 128 } |
129 | 129 |
130 } // namespace | 130 } // namespace |
OLD | NEW |