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 "sync/internal_api/public/change_record.h" | 5 #include "sync/internal_api/public/change_record.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 #include <stdint.h> |
| 9 |
7 #include <string> | 10 #include <string> |
8 | 11 |
9 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
11 #include "base/test/values_test_util.h" | 14 #include "base/test/values_test_util.h" |
12 #include "base/values.h" | 15 #include "base/values.h" |
13 #include "sync/protocol/extension_specifics.pb.h" | 16 #include "sync/protocol/extension_specifics.pb.h" |
14 #include "sync/protocol/proto_value_conversions.h" | 17 #include "sync/protocol/proto_value_conversions.h" |
15 #include "sync/protocol/sync.pb.h" | 18 #include "sync/protocol/sync.pb.h" |
16 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 size_t to_value_calls_; | 99 size_t to_value_calls_; |
97 size_t expected_to_value_calls_; | 100 size_t expected_to_value_calls_; |
98 }; | 101 }; |
99 | 102 |
100 TEST_F(ChangeRecordTest, ChangeRecordToValue) { | 103 TEST_F(ChangeRecordTest, ChangeRecordToValue) { |
101 sync_pb::EntitySpecifics old_specifics; | 104 sync_pb::EntitySpecifics old_specifics; |
102 old_specifics.mutable_extension()->set_id("old"); | 105 old_specifics.mutable_extension()->set_id("old"); |
103 sync_pb::EntitySpecifics new_specifics; | 106 sync_pb::EntitySpecifics new_specifics; |
104 old_specifics.mutable_extension()->set_id("new"); | 107 old_specifics.mutable_extension()->set_id("new"); |
105 | 108 |
106 const int64 kTestId = 5; | 109 const int64_t kTestId = 5; |
107 | 110 |
108 // Add | 111 // Add |
109 { | 112 { |
110 ChangeRecord record; | 113 ChangeRecord record; |
111 record.action = ChangeRecord::ACTION_ADD; | 114 record.action = ChangeRecord::ACTION_ADD; |
112 record.id = kTestId; | 115 record.id = kTestId; |
113 record.specifics = old_specifics; | 116 record.specifics = old_specifics; |
114 record.extra.reset(new TestExtraChangeRecordData()); | 117 record.extra.reset(new TestExtraChangeRecordData()); |
115 scoped_ptr<base::DictionaryValue> value(record.ToValue()); | 118 scoped_ptr<base::DictionaryValue> value(record.ToValue()); |
116 CheckChangeRecordValue(record, *value); | 119 CheckChangeRecordValue(record, *value); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 extra->set_expected_to_value_calls(2U); | 155 extra->set_expected_to_value_calls(2U); |
153 | 156 |
154 record.extra.reset(extra.release()); | 157 record.extra.reset(extra.release()); |
155 scoped_ptr<base::DictionaryValue> value(record.ToValue()); | 158 scoped_ptr<base::DictionaryValue> value(record.ToValue()); |
156 CheckChangeRecordValue(record, *value); | 159 CheckChangeRecordValue(record, *value); |
157 } | 160 } |
158 } | 161 } |
159 | 162 |
160 } // namespace | 163 } // namespace |
161 } // namespace syncer | 164 } // namespace syncer |
OLD | NEW |