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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/logging.h" | 6 #include "base/logging.h" |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/run_loop.h" |
10 #include "dbus/message.h" | 11 #include "dbus/message.h" |
11 #include "dbus/mock_bus.h" | 12 #include "dbus/mock_bus.h" |
12 #include "dbus/mock_exported_object.h" | 13 #include "dbus/mock_exported_object.h" |
13 #include "dbus/mock_object_proxy.h" | 14 #include "dbus/mock_object_proxy.h" |
14 #include "dbus/object_path.h" | 15 #include "dbus/object_path.h" |
15 #include "testing/gmock/include/gmock/gmock.h" | 16 #include "testing/gmock/include/gmock/gmock.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
17 | 18 |
18 using ::testing::_; | 19 using ::testing::_; |
19 using ::testing::Invoke; | 20 using ::testing::Invoke; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 MethodCall method_call("org.chromium.TestInterface", "Echo"); | 168 MethodCall method_call("org.chromium.TestInterface", "Echo"); |
168 MessageWriter writer(&method_call); | 169 MessageWriter writer(&method_call); |
169 writer.AppendString(kHello); | 170 writer.AppendString(kHello); |
170 | 171 |
171 // Call the method. | 172 // Call the method. |
172 proxy->CallMethod(&method_call, | 173 proxy->CallMethod(&method_call, |
173 ObjectProxy::TIMEOUT_USE_DEFAULT, | 174 ObjectProxy::TIMEOUT_USE_DEFAULT, |
174 base::Bind(&MockTest::OnResponse, | 175 base::Bind(&MockTest::OnResponse, |
175 base::Unretained(this))); | 176 base::Unretained(this))); |
176 // Run the message loop to let OnResponse be called. | 177 // Run the message loop to let OnResponse be called. |
177 message_loop_.Run(); | 178 base::RunLoop().Run(); |
178 | 179 |
179 EXPECT_EQ(kHello, response_string_); | 180 EXPECT_EQ(kHello, response_string_); |
180 } | 181 } |
181 | 182 |
182 } // namespace dbus | 183 } // namespace dbus |
OLD | NEW |