| 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 "components/sync/protocol/proto_value_conversions.h" | 7 #include "components/sync/protocol/proto_value_conversions.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 } | 109 } |
| 110 | 110 |
| 111 TEST_F(ProtoValueConversionsTest, AppNotificationToValue) { | 111 TEST_F(ProtoValueConversionsTest, AppNotificationToValue) { |
| 112 TestSpecificsToValue(AppNotificationToValue); | 112 TestSpecificsToValue(AppNotificationToValue); |
| 113 } | 113 } |
| 114 | 114 |
| 115 TEST_F(ProtoValueConversionsTest, AppSettingSpecificsToValue) { | 115 TEST_F(ProtoValueConversionsTest, AppSettingSpecificsToValue) { |
| 116 sync_pb::AppNotificationSettings specifics; | 116 sync_pb::AppNotificationSettings specifics; |
| 117 specifics.set_disabled(true); | 117 specifics.set_disabled(true); |
| 118 specifics.set_oauth_client_id("some_id_value"); | 118 specifics.set_oauth_client_id("some_id_value"); |
| 119 std::unique_ptr<base::DictionaryValue> value(AppSettingsToValue(specifics)); | 119 std::unique_ptr<base::DictionaryValue> |
| 120 value(AppNotificationSettingsToValue(specifics)); |
| 120 EXPECT_FALSE(value->empty()); | 121 EXPECT_FALSE(value->empty()); |
| 121 bool disabled_value = false; | 122 bool disabled_value = false; |
| 122 std::string oauth_client_id_value; | 123 std::string oauth_client_id_value; |
| 123 EXPECT_TRUE(value->GetBoolean("disabled", &disabled_value)); | 124 EXPECT_TRUE(value->GetBoolean("disabled", &disabled_value)); |
| 124 EXPECT_EQ(true, disabled_value); | 125 EXPECT_EQ(true, disabled_value); |
| 125 EXPECT_TRUE(value->GetString("oauth_client_id", &oauth_client_id_value)); | 126 EXPECT_TRUE(value->GetString("oauth_client_id", &oauth_client_id_value)); |
| 126 EXPECT_EQ("some_id_value", oauth_client_id_value); | 127 EXPECT_EQ("some_id_value", oauth_client_id_value); |
| 127 } | 128 } |
| 128 | 129 |
| 129 TEST_F(ProtoValueConversionsTest, AppSpecificsToValue) { | 130 TEST_F(ProtoValueConversionsTest, AppSpecificsToValue) { |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 EXPECT_FALSE(ValueHasSpecifics(*(value_without_specifics.get()), | 417 EXPECT_FALSE(ValueHasSpecifics(*(value_without_specifics.get()), |
| 417 "get_updates.entries")); | 418 "get_updates.entries")); |
| 418 } | 419 } |
| 419 | 420 |
| 420 TEST_F(ProtoValueConversionsTest, AttachmentIdProtoToValue) { | 421 TEST_F(ProtoValueConversionsTest, AttachmentIdProtoToValue) { |
| 421 TestSpecificsToValue(AttachmentIdProtoToValue); | 422 TestSpecificsToValue(AttachmentIdProtoToValue); |
| 422 } | 423 } |
| 423 | 424 |
| 424 } // namespace | 425 } // namespace |
| 425 } // namespace syncer | 426 } // namespace syncer |
| OLD | NEW |