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 "chromeos/dbus/gsm_sms_client.h" | 5 #include "chromeos/dbus/gsm_sms_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "dbus/message.h" | 10 #include "dbus/message.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // Set an expectation so mock_bus's GetObjectProxy() for the given | 92 // Set an expectation so mock_bus's GetObjectProxy() for the given |
93 // service name and the object path will return mock_proxy_. | 93 // service name and the object path will return mock_proxy_. |
94 EXPECT_CALL(*mock_bus_.get(), | 94 EXPECT_CALL(*mock_bus_.get(), |
95 GetObjectProxy(kServiceName, dbus::ObjectPath(kObjectPath))) | 95 GetObjectProxy(kServiceName, dbus::ObjectPath(kObjectPath))) |
96 .WillOnce(Return(mock_proxy_.get())); | 96 .WillOnce(Return(mock_proxy_.get())); |
97 | 97 |
98 // ShutdownAndBlock() will be called in TearDown(). | 98 // ShutdownAndBlock() will be called in TearDown(). |
99 EXPECT_CALL(*mock_bus_.get(), ShutdownAndBlock()).WillOnce(Return()); | 99 EXPECT_CALL(*mock_bus_.get(), ShutdownAndBlock()).WillOnce(Return()); |
100 | 100 |
101 // Create a client with the mock bus. | 101 // Create a client with the mock bus. |
102 client_.reset(GsmSMSClient::Create(REAL_DBUS_CLIENT_IMPLEMENTATION)); | 102 client_.reset(GsmSMSClient::Create()); |
103 client_->Init(mock_bus_.get()); | 103 client_->Init(mock_bus_.get()); |
104 } | 104 } |
105 | 105 |
106 virtual void TearDown() OVERRIDE { | 106 virtual void TearDown() OVERRIDE { |
107 mock_bus_->ShutdownAndBlock(); | 107 mock_bus_->ShutdownAndBlock(); |
108 } | 108 } |
109 | 109 |
110 // Handles Delete method call. | 110 // Handles Delete method call. |
111 void OnDelete(dbus::MethodCall* method_call, | 111 void OnDelete(dbus::MethodCall* method_call, |
112 int timeout_ms, | 112 int timeout_ms, |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 // Call List. | 317 // Call List. |
318 client_->List(kServiceName, dbus::ObjectPath(kObjectPath), | 318 client_->List(kServiceName, dbus::ObjectPath(kObjectPath), |
319 base::Bind(&MockListCallback::Run, | 319 base::Bind(&MockListCallback::Run, |
320 base::Unretained(&callback))); | 320 base::Unretained(&callback))); |
321 | 321 |
322 // Run the message loop. | 322 // Run the message loop. |
323 message_loop_.RunUntilIdle(); | 323 message_loop_.RunUntilIdle(); |
324 } | 324 } |
325 | 325 |
326 } // namespace chromeos | 326 } // namespace chromeos |
OLD | NEW |