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 "components/sync/protocol/proto_value_conversions.h" | 5 #include "components/sync/protocol/proto_value_conversions.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 } | 85 } |
86 | 86 |
87 TEST_F(ProtoValueConversionsTest, TabNavigationToValue) { | 87 TEST_F(ProtoValueConversionsTest, TabNavigationToValue) { |
88 TestSpecificsToValue(TabNavigationToValue); | 88 TestSpecificsToValue(TabNavigationToValue); |
89 } | 89 } |
90 | 90 |
91 TEST_F(ProtoValueConversionsTest, NavigationRedirectToValue) { | 91 TEST_F(ProtoValueConversionsTest, NavigationRedirectToValue) { |
92 TestSpecificsToValue(NavigationRedirectToValue); | 92 TestSpecificsToValue(NavigationRedirectToValue); |
93 } | 93 } |
94 | 94 |
| 95 TEST_F(ProtoValueConversionsTest, PasswordSpecifics) { |
| 96 sync_pb::PasswordSpecifics specifics; |
| 97 specifics.mutable_client_only_encrypted_data(); |
| 98 auto value = PasswordSpecificsToValue(specifics); |
| 99 EXPECT_FALSE(value->Get("client_only_encrypted_data", nullptr)); |
| 100 } |
| 101 |
95 TEST_F(ProtoValueConversionsTest, PasswordSpecificsData) { | 102 TEST_F(ProtoValueConversionsTest, PasswordSpecificsData) { |
96 sync_pb::PasswordSpecificsData specifics; | 103 sync_pb::PasswordSpecificsData specifics; |
97 specifics.set_password_value("secret"); | 104 specifics.set_password_value("secret"); |
98 std::unique_ptr<base::DictionaryValue> value( | 105 std::unique_ptr<base::DictionaryValue> value( |
99 PasswordSpecificsDataToValue(specifics)); | 106 PasswordSpecificsDataToValue(specifics)); |
100 EXPECT_FALSE(value->empty()); | 107 EXPECT_FALSE(value->empty()); |
101 std::string password_value; | 108 std::string password_value; |
102 EXPECT_TRUE(value->GetString("password_value", &password_value)); | 109 EXPECT_TRUE(value->GetString("password_value", &password_value)); |
103 EXPECT_EQ("<redacted>", password_value); | 110 EXPECT_EQ("<redacted>", password_value); |
104 } | 111 } |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 EXPECT_FALSE(ValueHasSpecifics(*(value_without_specifics.get()), | 488 EXPECT_FALSE(ValueHasSpecifics(*(value_without_specifics.get()), |
482 "get_updates.entries")); | 489 "get_updates.entries")); |
483 } | 490 } |
484 | 491 |
485 TEST_F(ProtoValueConversionsTest, AttachmentIdProtoToValue) { | 492 TEST_F(ProtoValueConversionsTest, AttachmentIdProtoToValue) { |
486 TestSpecificsToValue(AttachmentIdProtoToValue); | 493 TestSpecificsToValue(AttachmentIdProtoToValue); |
487 } | 494 } |
488 | 495 |
489 } // namespace | 496 } // namespace |
490 } // namespace syncer | 497 } // namespace syncer |
OLD | NEW |