Chromium Code Reviews| Index: sync/internal_api/sync_manager_impl_unittest.cc |
| diff --git a/sync/internal_api/sync_manager_impl_unittest.cc b/sync/internal_api/sync_manager_impl_unittest.cc |
| index ee722542a7e5e09c5c9416ad2829311def3e870e..337d99f62eecb60ac16e71ffb93b7f0592d18be3 100644 |
| --- a/sync/internal_api/sync_manager_impl_unittest.cc |
| +++ b/sync/internal_api/sync_manager_impl_unittest.cc |
| @@ -75,6 +75,8 @@ |
| #include "sync/util/time.h" |
| #include "testing/gmock/include/gmock/gmock.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| +#include "third_party/protobuf/src/google/protobuf/io/coded_stream.h" |
| +#include "third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.h" |
| #include "url/gurl.h" |
| using base::ExpectDictStringValue; |
| @@ -630,11 +632,19 @@ TEST_F(SyncApiTest, BaseNodeSetSpecificsPreservesUnknownFields) { |
| sync_pb::EntitySpecifics entity_specifics; |
| entity_specifics.mutable_bookmark()->set_url("http://www.google.com"); |
| - entity_specifics.mutable_unknown_fields()->AddFixed32(5, 100); |
| + { |
| + ::google::protobuf::io::StringOutputStream unknown_fields_stram( |
|
Nicolas Zea
2016/04/05 22:47:40
stram -> stream
xyzzyz
2016/04/06 17:22:52
Good catch!
|
| + entity_specifics.mutable_unknown_fields()); |
| + ::google::protobuf::io::CodedOutputStream output(&unknown_fields_stram); |
| + const int tag = 5; |
| + const int value = 100; |
| + output.WriteTag(tag); |
| + output.WriteLittleEndian32(value); |
| + } |
| node.SetEntitySpecifics(entity_specifics); |
| EXPECT_FALSE(node.GetEntitySpecifics().unknown_fields().empty()); |
| - entity_specifics.mutable_unknown_fields()->Clear(); |
| + entity_specifics.mutable_unknown_fields()->clear(); |
| node.SetEntitySpecifics(entity_specifics); |
| EXPECT_FALSE(node.GetEntitySpecifics().unknown_fields().empty()); |
|
Nicolas Zea
2016/04/05 22:47:40
What do you think about verifying the values in th
xyzzyz
2016/04/06 17:22:52
I added some verification, please take a look.
|
| } |