| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/logging.h" |
| 6 #include "base/scoped_ptr.h" |
| 7 #include "net/dbus/dbus.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 |
| 10 namespace net { |
| 11 |
| 12 TEST(DBusTest, Test) { |
| 13 dbus::Bus bus(dbus::Bus::SESSION); |
| 14 scoped_ptr<dbus::ObjectProxy> proxy(bus.GetObjectProxy( |
| 15 "com.example.SampleService", |
| 16 "/SomeObject")); |
| 17 dbus::MethodCall method_call; |
| 18 dbus::MessageBuilder builder(&method_call); |
| 19 builder.AppendString("hello"); |
| 20 dbus::Response response; |
| 21 CHECK(proxy->CallMethodSync("com.example.SampleInterface", |
| 22 "HelloWorld", |
| 23 &method_call, |
| 24 &response)); |
| 25 dbus::MessageReader reader(&response); |
| 26 dbus::MessageReader sub_reader(&response); |
| 27 CHECK(reader.PopArray(&sub_reader)); |
| 28 std::string string_value; |
| 29 CHECK(sub_reader.PopString(&string_value)); |
| 30 LOG(ERROR) << string_value; |
| 31 CHECK(sub_reader.PopString(&string_value)); |
| 32 LOG(ERROR) << string_value; |
| 33 } |
| 34 |
| 35 } // namespace net |
| OLD | NEW |