| Index: dbus/message_unittest.cc
|
| diff --git a/dbus/message_unittest.cc b/dbus/message_unittest.cc
|
| index 9c76b0d28fa50d77c8fa4d9da0e7a176b3735122..874851d858e29fbf661c89bc50c03ceaed82ed23 100644
|
| --- a/dbus/message_unittest.cc
|
| +++ b/dbus/message_unittest.cc
|
| @@ -7,6 +7,7 @@
|
| #include "base/basictypes.h"
|
| #include "base/logging.h"
|
| #include "base/memory/scoped_ptr.h"
|
| +#include "dbus/test_proto.pb.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| // Test that a byte can be properly written and read. We only have this
|
| @@ -226,6 +227,22 @@ TEST(MessageTest, ArrayOfObjectPaths) {
|
| EXPECT_EQ("/object/path/3", output_object_paths[2]);
|
| }
|
|
|
| +TEST(MessageTest, ProtoBuf) {
|
| + scoped_ptr<dbus::Response> message(dbus::Response::CreateEmpty());
|
| + dbus::MessageWriter writer(message.get());
|
| + TestProto send_message;
|
| + send_message.set_text("testing");
|
| + send_message.set_number(123);
|
| + writer.AppendProtoAsArrayOfBytes(send_message);
|
| +
|
| + dbus::MessageReader reader(message.get());
|
| + TestProto receive_message;
|
| + ASSERT_TRUE(reader.PopArrayOfBytesAsProto(&receive_message));
|
| + EXPECT_EQ(receive_message.text(), send_message.text());
|
| + EXPECT_EQ(receive_message.number(), send_message.number());
|
| +}
|
| +
|
| +
|
| // Test that an array can be properly written and read. We only have this
|
| // test for array, as repeating this for other container types is too
|
| // redundant.
|
|
|