| 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 // Keep this file in sync with the .proto files in this directory. | 5 // Keep this file in sync with the .proto files in this directory. |
| 6 | 6 |
| 7 #include "chrome/browser/sync/protocol/proto_value_conversions.h" | 7 #include "sync/protocol/proto_value_conversions.h" |
| 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/syncable/model_type.h" | |
| 12 #include "sync/protocol/app_notification_specifics.pb.h" | 11 #include "sync/protocol/app_notification_specifics.pb.h" |
| 13 #include "sync/protocol/app_setting_specifics.pb.h" | 12 #include "sync/protocol/app_setting_specifics.pb.h" |
| 14 #include "sync/protocol/app_specifics.pb.h" | 13 #include "sync/protocol/app_specifics.pb.h" |
| 15 #include "sync/protocol/autofill_specifics.pb.h" | 14 #include "sync/protocol/autofill_specifics.pb.h" |
| 16 #include "sync/protocol/bookmark_specifics.pb.h" | 15 #include "sync/protocol/bookmark_specifics.pb.h" |
| 17 #include "sync/protocol/encryption.pb.h" | 16 #include "sync/protocol/encryption.pb.h" |
| 18 #include "sync/protocol/extension_setting_specifics.pb.h" | 17 #include "sync/protocol/extension_setting_specifics.pb.h" |
| 19 #include "sync/protocol/extension_specifics.pb.h" | 18 #include "sync/protocol/extension_specifics.pb.h" |
| 20 #include "sync/protocol/nigori_specifics.pb.h" | 19 #include "sync/protocol/nigori_specifics.pb.h" |
| 21 #include "sync/protocol/password_specifics.pb.h" | 20 #include "sync/protocol/password_specifics.pb.h" |
| 22 #include "sync/protocol/preference_specifics.pb.h" | 21 #include "sync/protocol/preference_specifics.pb.h" |
| 23 #include "sync/protocol/search_engine_specifics.pb.h" | 22 #include "sync/protocol/search_engine_specifics.pb.h" |
| 24 #include "sync/protocol/session_specifics.pb.h" | 23 #include "sync/protocol/session_specifics.pb.h" |
| 25 #include "sync/protocol/sync.pb.h" | 24 #include "sync/protocol/sync.pb.h" |
| 26 #include "sync/protocol/theme_specifics.pb.h" | 25 #include "sync/protocol/theme_specifics.pb.h" |
| 27 #include "sync/protocol/typed_url_specifics.pb.h" | 26 #include "sync/protocol/typed_url_specifics.pb.h" |
| 27 #include "sync/syncable/model_type.h" |
| 28 #include "testing/gtest/include/gtest/gtest.h" | 28 #include "testing/gtest/include/gtest/gtest.h" |
| 29 | 29 |
| 30 namespace browser_sync { | 30 namespace browser_sync { |
| 31 namespace { | 31 namespace { |
| 32 | 32 |
| 33 class ProtoValueConversionsTest : public testing::Test { | 33 class ProtoValueConversionsTest : public testing::Test { |
| 34 protected: | 34 protected: |
| 35 template <class T> | 35 template <class T> |
| 36 void TestSpecificsToValue( | 36 void TestSpecificsToValue( |
| 37 DictionaryValue* (*specifics_to_value)(const T&)) { | 37 DictionaryValue* (*specifics_to_value)(const T&)) { |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 | 182 |
| 183 #undef SET_FIELD | 183 #undef SET_FIELD |
| 184 | 184 |
| 185 scoped_ptr<DictionaryValue> value(EntitySpecificsToValue(specifics)); | 185 scoped_ptr<DictionaryValue> value(EntitySpecificsToValue(specifics)); |
| 186 EXPECT_EQ(syncable::MODEL_TYPE_COUNT - syncable::FIRST_REAL_MODEL_TYPE, | 186 EXPECT_EQ(syncable::MODEL_TYPE_COUNT - syncable::FIRST_REAL_MODEL_TYPE, |
| 187 static_cast<int>(value->size())); | 187 static_cast<int>(value->size())); |
| 188 } | 188 } |
| 189 | 189 |
| 190 } // namespace | 190 } // namespace |
| 191 } // namespace browser_sync | 191 } // namespace browser_sync |
| OLD | NEW |