Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1205)

Unified Diff: net/dbus/dbus_unittest.cc

Issue 7413004: Uploading for backup... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« net/dbus/dbus.cc ('K') | « net/dbus/dbus.cc ('k') | net/net.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dbus/dbus_unittest.cc
diff --git a/net/dbus/dbus_unittest.cc b/net/dbus/dbus_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..fc64a1ec37954b4502159faeda769ddf7652fe91
--- /dev/null
+++ b/net/dbus/dbus_unittest.cc
@@ -0,0 +1,35 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/logging.h"
+#include "base/scoped_ptr.h"
+#include "net/dbus/dbus.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace net {
+
+TEST(DBusTest, Test) {
+ dbus::Bus bus(dbus::Bus::SESSION);
+ scoped_ptr<dbus::ObjectProxy> proxy(bus.GetObjectProxy(
+ "com.example.SampleService",
+ "/SomeObject"));
+ dbus::MethodCall method_call;
+ dbus::MessageBuilder builder(&method_call);
+ builder.AppendString("hello");
+ dbus::Response response;
+ CHECK(proxy->CallMethodSync("com.example.SampleInterface",
+ "HelloWorld",
+ &method_call,
+ &response));
+ dbus::MessageReader reader(&response);
+ dbus::MessageReader sub_reader(&response);
+ CHECK(reader.PopArray(&sub_reader));
+ std::string string_value;
+ CHECK(sub_reader.PopString(&string_value));
+ LOG(ERROR) << string_value;
+ CHECK(sub_reader.PopString(&string_value));
+ LOG(ERROR) << string_value;
+}
+
+} // namespace net
« net/dbus/dbus.cc ('K') | « net/dbus/dbus.cc ('k') | net/net.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698