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/ibus/ibus_config_client.h" | 5 #include "chromeos/dbus/ibus/ibus_config_client.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 _)).WillOnce(Invoke(&handler, | 323 _)).WillOnce(Invoke(&handler, |
324 &NameOwnerChangedHandler::OnConnectToSignal)); | 324 &NameOwnerChangedHandler::OnConnectToSignal)); |
325 client_->InitializeAsync(base::Bind(&base::DoNothing)); | 325 client_->InitializeAsync(base::Bind(&base::DoNothing)); |
326 mock_get_name_owner_method_call.EmitReplyCallback(":0.1"); | 326 mock_get_name_owner_method_call.EmitReplyCallback(":0.1"); |
327 } | 327 } |
328 | 328 |
329 // The IBus config client to be tested. | 329 // The IBus config client to be tested. |
330 scoped_ptr<IBusConfigClient> client_; | 330 scoped_ptr<IBusConfigClient> client_; |
331 | 331 |
332 // A message loop to emulate asynchronous behavior. | 332 // A message loop to emulate asynchronous behavior. |
333 MessageLoop message_loop_; | 333 base::MessageLoop message_loop_; |
334 scoped_refptr<dbus::MockBus> mock_bus_; | 334 scoped_refptr<dbus::MockBus> mock_bus_; |
335 scoped_refptr<dbus::MockObjectProxy> mock_proxy_; | 335 scoped_refptr<dbus::MockObjectProxy> mock_proxy_; |
336 }; | 336 }; |
337 | 337 |
338 TEST_F(IBusConfigClientTest, SetStringValueTest) { | 338 TEST_F(IBusConfigClientTest, SetStringValueTest) { |
339 // Set expectations | 339 // Set expectations |
340 InitializeSync(); | 340 InitializeSync(); |
341 const char value[] = "value"; | 341 const char value[] = "value"; |
342 SetStringValueHandler handler(kSection, kKey, value, HANDLER_SUCCESS); | 342 SetStringValueHandler handler(kSection, kKey, value, HANDLER_SUCCESS); |
343 EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) | 343 EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 "", | 622 "", |
623 ":0.2"); | 623 ":0.2"); |
624 | 624 |
625 // Make sure it is possible to emit method calls. | 625 // Make sure it is possible to emit method calls. |
626 client_->SetBoolValue(kKey, kSection, value, | 626 client_->SetBoolValue(kKey, kSection, value, |
627 base::Bind(&MockErrorCallback::Run, | 627 base::Bind(&MockErrorCallback::Run, |
628 base::Unretained(&error_callback))); | 628 base::Unretained(&error_callback))); |
629 } | 629 } |
630 | 630 |
631 } // namespace chromeos | 631 } // namespace chromeos |
OLD | NEW |