diff options
author | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-14 07:30:38 +0000 |
---|---|---|
committer | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-14 07:30:38 +0000 |
commit | 144b6c4d67fe81336112e4d702fb90c7aedb9bbf (patch) | |
tree | ea4c040b17e2fdb754e0416749abd51b4937b991 /chromeos | |
parent | 3c7ca2f02b64ba078a4aab208dc35d0a002fc168 (diff) | |
download | chromium_src-144b6c4d67fe81336112e4d702fb90c7aedb9bbf.zip chromium_src-144b6c4d67fe81336112e4d702fb90c7aedb9bbf.tar.gz chromium_src-144b6c4d67fe81336112e4d702fb90c7aedb9bbf.tar.bz2 |
Update CrOS to use scoped_refptr<T>::get() rather than implicit "operator T*"
BUG=110610
TBR=darin
Review URL: https://chromiumcodereview.appspot.com/16998003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206357 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos')
20 files changed, 367 insertions, 345 deletions
diff --git a/chromeos/audio/cras_audio_handler.cc b/chromeos/audio/cras_audio_handler.cc index 7ad5c84..fdd7949 100644 --- a/chromeos/audio/cras_audio_handler.cc +++ b/chromeos/audio/cras_audio_handler.cc @@ -275,7 +275,7 @@ CrasAudioHandler::CrasAudioHandler( has_alternative_output_(false), output_mute_locked_(false), input_mute_locked_(false) { - if (!audio_pref_handler) + if (!audio_pref_handler.get()) return; // If the DBusThreadManager or the CrasAudioClient aren't available, there // isn't much we can do. This should only happen when running tests. @@ -295,7 +295,7 @@ CrasAudioHandler::~CrasAudioHandler() { return; chromeos::DBusThreadManager::Get()->GetCrasAudioClient()-> RemoveObserver(this); - if (audio_pref_handler_) + if (audio_pref_handler_.get()) audio_pref_handler_->RemoveAudioPrefObserver(this); audio_pref_handler_ = NULL; } diff --git a/chromeos/dbus/blocking_method_caller_unittest.cc b/chromeos/dbus/blocking_method_caller_unittest.cc index 2abfd64..5102b62 100644 --- a/chromeos/dbus/blocking_method_caller_unittest.cc +++ b/chromeos/dbus/blocking_method_caller_unittest.cc @@ -39,25 +39,24 @@ class BlockingMethodCallerTest : public testing::Test { // Set an expectation so mock_proxy's CallMethodAndBlock() will use // CreateMockProxyResponse() to return responses. - EXPECT_CALL(*mock_proxy_, MockCallMethodAndBlock(_, _)) - .WillRepeatedly(Invoke( - this, &BlockingMethodCallerTest::CreateMockProxyResponse)); + EXPECT_CALL(*mock_proxy_.get(), MockCallMethodAndBlock(_, _)) + .WillRepeatedly( + Invoke(this, &BlockingMethodCallerTest::CreateMockProxyResponse)); // Set an expectation so mock_bus's GetObjectProxy() for the given // service name and the object path will return mock_proxy_. - EXPECT_CALL(*mock_bus_, GetObjectProxy( - "org.chromium.TestService", - dbus::ObjectPath("/org/chromium/TestObject"))) + EXPECT_CALL(*mock_bus_.get(), + GetObjectProxy("org.chromium.TestService", + dbus::ObjectPath("/org/chromium/TestObject"))) .WillOnce(Return(mock_proxy_.get())); // Set an expectation so mock_bus's PostTaskToDBusThread() will run the // given task. - EXPECT_CALL(*mock_bus_, PostTaskToDBusThread(_, _)) - .WillRepeatedly(Invoke( - this, &BlockingMethodCallerTest::RunTask)); + EXPECT_CALL(*mock_bus_.get(), PostTaskToDBusThread(_, _)) + .WillRepeatedly(Invoke(this, &BlockingMethodCallerTest::RunTask)); // ShutdownAndBlock() will be called in TearDown(). - EXPECT_CALL(*mock_bus_, ShutdownAndBlock()).WillOnce(Return()); + EXPECT_CALL(*mock_bus_.get(), ShutdownAndBlock()).WillOnce(Return()); } virtual void TearDown() { diff --git a/chromeos/dbus/cros_disks_client.cc b/chromeos/dbus/cros_disks_client.cc index c5c3681..915e4ec 100644 --- a/chromeos/dbus/cros_disks_client.cc +++ b/chromeos/dbus/cros_disks_client.cc @@ -434,11 +434,9 @@ class CrosDisksClientStubImpl : public CrosDisksClient { // Perform fake mount. base::PostTaskAndReplyWithResult( - base::WorkerPool::GetTaskRunner(true /* task_is_slow */), + base::WorkerPool::GetTaskRunner(true /* task_is_slow */).get(), FROM_HERE, - base::Bind(&PerformFakeMount, - source_path, - mounted_path), + base::Bind(&PerformFakeMount, source_path, mounted_path), base::Bind(&CrosDisksClientStubImpl::ContinueMount, weak_ptr_factory_.GetWeakPtr(), source_path, diff --git a/chromeos/dbus/dbus_thread_manager.cc b/chromeos/dbus/dbus_thread_manager.cc index f76edb1..41a576a 100644 --- a/chromeos/dbus/dbus_thread_manager.cc +++ b/chromeos/dbus/dbus_thread_manager.cc @@ -181,7 +181,7 @@ class DBusThreadManagerImpl : public DBusThreadManager { virtual void InitIBusBus( const std::string &ibus_address, const base::Closure& on_disconnected_callback) OVERRIDE { - DCHECK(!ibus_bus_); + DCHECK(!ibus_bus_.get()); dbus::Bus::Options ibus_bus_options; ibus_bus_options.bus_type = dbus::Bus::CUSTOM_ADDRESS; ibus_bus_options.address = ibus_address; diff --git a/chromeos/dbus/gsm_sms_client_unittest.cc b/chromeos/dbus/gsm_sms_client_unittest.cc index 6caf93a..0f15271 100644 --- a/chromeos/dbus/gsm_sms_client_unittest.cc +++ b/chromeos/dbus/gsm_sms_client_unittest.cc @@ -82,23 +82,25 @@ class GsmSMSClientTest : public testing::Test { // Set an expectation so mock_proxy's ConnectToSignal() will use // OnConnectToSignal() to run the callback. - EXPECT_CALL(*mock_proxy_, ConnectToSignal( - modemmanager::kModemManagerSMSInterface, - modemmanager::kSMSReceivedSignal, _, _)) + EXPECT_CALL(*mock_proxy_.get(), + ConnectToSignal(modemmanager::kModemManagerSMSInterface, + modemmanager::kSMSReceivedSignal, + _, + _)) .WillRepeatedly(Invoke(this, &GsmSMSClientTest::OnConnectToSignal)); // Set an expectation so mock_bus's GetObjectProxy() for the given // service name and the object path will return mock_proxy_. - EXPECT_CALL(*mock_bus_, GetObjectProxy(kServiceName, - dbus::ObjectPath(kObjectPath))) + EXPECT_CALL(*mock_bus_.get(), + GetObjectProxy(kServiceName, dbus::ObjectPath(kObjectPath))) .WillOnce(Return(mock_proxy_.get())); // ShutdownAndBlock() will be called in TearDown(). - EXPECT_CALL(*mock_bus_, ShutdownAndBlock()).WillOnce(Return()); + EXPECT_CALL(*mock_bus_.get(), ShutdownAndBlock()).WillOnce(Return()); // Create a client with the mock bus. - client_.reset(GsmSMSClient::Create(REAL_DBUS_CLIENT_IMPLEMENTATION, - mock_bus_)); + client_.reset( + GsmSMSClient::Create(REAL_DBUS_CLIENT_IMPLEMENTATION, mock_bus_.get())); } virtual void TearDown() OVERRIDE { @@ -221,7 +223,7 @@ TEST_F(GsmSMSClientTest, Delete) { // Set expectations. const uint32 kIndex = 42; expected_index_ = kIndex; - EXPECT_CALL(*mock_proxy_, CallMethod(_, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethod(_, _, _)) .WillOnce(Invoke(this, &GsmSMSClientTest::OnDelete)); MockDeleteCallback callback; EXPECT_CALL(callback, Run()).Times(1); @@ -241,7 +243,7 @@ TEST_F(GsmSMSClientTest, Get) { // Set expectations. const uint32 kIndex = 42; expected_index_ = kIndex; - EXPECT_CALL(*mock_proxy_, CallMethod(_, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethod(_, _, _)) .WillOnce(Invoke(this, &GsmSMSClientTest::OnGet)); MockGetCallback callback; EXPECT_CALL(callback, Run(_)) @@ -279,7 +281,7 @@ TEST_F(GsmSMSClientTest, Get) { TEST_F(GsmSMSClientTest, List) { // Set expectations. - EXPECT_CALL(*mock_proxy_, CallMethod(_, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethod(_, _, _)) .WillOnce(Invoke(this, &GsmSMSClientTest::OnList)); MockListCallback callback; EXPECT_CALL(callback, Run(_)) diff --git a/chromeos/dbus/ibus/ibus_client_unittest.cc b/chromeos/dbus/ibus/ibus_client_unittest.cc index 3220e52..d4507b5 100644 --- a/chromeos/dbus/ibus/ibus_client_unittest.cc +++ b/chromeos/dbus/ibus/ibus_client_unittest.cc @@ -137,14 +137,14 @@ class IBusClientTest : public testing::Test { ibus::kServiceName, dbus::ObjectPath( ibus::bus::kServicePath)); - EXPECT_CALL(*mock_bus_, GetObjectProxy(ibus::kServiceName, - dbus::ObjectPath( - ibus::bus::kServicePath))) + EXPECT_CALL(*mock_bus_.get(), + GetObjectProxy(ibus::kServiceName, + dbus::ObjectPath(ibus::bus::kServicePath))) .WillOnce(Return(mock_proxy_.get())); - EXPECT_CALL(*mock_bus_, ShutdownAndBlock()); - client_.reset(IBusClient::Create(REAL_DBUS_CLIENT_IMPLEMENTATION, - mock_bus_)); + EXPECT_CALL(*mock_bus_.get(), ShutdownAndBlock()); + client_.reset( + IBusClient::Create(REAL_DBUS_CLIENT_IMPLEMENTATION, mock_bus_.get())); } virtual void TearDown() OVERRIDE { @@ -168,7 +168,7 @@ TEST_F(IBusClientTest, CreateInputContextTest) { // Set expectations. const dbus::ObjectPath kInputContextObjectPath = dbus::ObjectPath("/some/object/path"); - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillOnce(Invoke(this, &IBusClientTest::OnCreateInputContext)); MockCreateInputContextCallback callback; EXPECT_CALL(callback, Run(kInputContextObjectPath)); @@ -195,7 +195,7 @@ TEST_F(IBusClientTest, CreateInputContextTest) { TEST_F(IBusClientTest, CreateInputContext_NullResponseFail) { // Set expectations. - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillOnce(Invoke(this, &IBusClientTest::OnCreateInputContext)); MockCreateInputContextCallback callback; EXPECT_CALL(callback, Run(_)).Times(0); @@ -219,7 +219,7 @@ TEST_F(IBusClientTest, CreateInputContext_NullResponseFail) { TEST_F(IBusClientTest, CreateInputContext_InvalidResponseFail) { // Set expectations. - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillOnce(Invoke(this, &IBusClientTest::OnCreateInputContext)); MockCreateInputContextCallback callback; EXPECT_CALL(callback, Run(_)).Times(0); @@ -244,7 +244,7 @@ TEST_F(IBusClientTest, CreateInputContext_InvalidResponseFail) { TEST_F(IBusClientTest, CreateInputContext_MethodCallFail) { // Set expectations - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillOnce(Invoke(this, &IBusClientTest::OnCreateInputContextFail)); MockCreateInputContextCallback callback; EXPECT_CALL(callback, Run(_)).Times(0); @@ -268,7 +268,7 @@ TEST_F(IBusClientTest, CreateInputContext_MethodCallFail) { TEST_F(IBusClientTest, SetGlobalEngineTest) { // Set expectations - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillOnce(Invoke(this, &IBusClientTest::OnSetGlobalEngine)); MockErrorCallback error_callback; EXPECT_CALL(error_callback, Run()).Times(0); @@ -292,7 +292,7 @@ TEST_F(IBusClientTest, SetGlobalEngineTest) { TEST_F(IBusClientTest, SetGlobalEngineTest_InvalidResponse) { // Set expectations - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillOnce(Invoke(this, &IBusClientTest::OnSetGlobalEngineFail)); MockErrorCallback error_callback; EXPECT_CALL(error_callback, Run()); @@ -315,7 +315,7 @@ TEST_F(IBusClientTest, SetGlobalEngineTest_InvalidResponse) { TEST_F(IBusClientTest, SetGlobalEngineTest_MethodCallFail) { // Set expectations - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillOnce(Invoke(this, &IBusClientTest::OnSetGlobalEngineFail)); MockErrorCallback error_callback; EXPECT_CALL(error_callback, Run()); @@ -339,7 +339,7 @@ TEST_F(IBusClientTest, SetGlobalEngineTest_MethodCallFail) { TEST_F(IBusClientTest, ExitTest) { // Set expectations - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillOnce(Invoke(this, &IBusClientTest::OnExit)); MockErrorCallback error_callback; EXPECT_CALL(error_callback, Run()).Times(0); @@ -363,7 +363,7 @@ TEST_F(IBusClientTest, ExitTest) { TEST_F(IBusClientTest, ExitTest_InvalidResponse) { // Set expectations - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillOnce(Invoke(this, &IBusClientTest::OnExit)); MockErrorCallback error_callback; EXPECT_CALL(error_callback, Run()); @@ -386,7 +386,7 @@ TEST_F(IBusClientTest, ExitTest_InvalidResponse) { TEST_F(IBusClientTest, ExitTest_MethodCallFail) { // Set expectations - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillOnce(Invoke(this, &IBusClientTest::OnExitFail)); MockErrorCallback error_callback; EXPECT_CALL(error_callback, Run()); diff --git a/chromeos/dbus/ibus/ibus_config_client_unittest.cc b/chromeos/dbus/ibus/ibus_config_client_unittest.cc index 5e636b9..7842da9 100644 --- a/chromeos/dbus/ibus/ibus_config_client_unittest.cc +++ b/chromeos/dbus/ibus/ibus_config_client_unittest.cc @@ -282,9 +282,9 @@ class IBusConfigClientTest : public testing::Test { ibus::kServiceName, dbus::ObjectPath( ibus::config::kServicePath)); - EXPECT_CALL(*mock_bus_, ShutdownAndBlock()); + EXPECT_CALL(*mock_bus_.get(), ShutdownAndBlock()); client_.reset(IBusConfigClient::Create(REAL_DBUS_CLIENT_IMPLEMENTATION, - mock_bus_)); + mock_bus_.get())); // Surpress uninteresting mock function call warning. EXPECT_CALL(*mock_bus_.get(), AssertOnOriginThread()) @@ -297,31 +297,30 @@ class IBusConfigClientTest : public testing::Test { // Initialize |client_| by replying valid owner name synchronously. void InitializeSync() { - EXPECT_CALL(*mock_bus_, GetObjectProxy(ibus::config::kServiceName, - dbus::ObjectPath( - ibus::config::kServicePath))) + EXPECT_CALL(*mock_bus_.get(), + GetObjectProxy(ibus::config::kServiceName, + dbus::ObjectPath(ibus::config::kServicePath))) .WillOnce(Return(mock_proxy_.get())); scoped_refptr<dbus::MockObjectProxy> mock_dbus_proxy = new dbus::MockObjectProxy(mock_bus_.get(), ibus::kDBusServiceName, dbus::ObjectPath(ibus::kDBusObjectPath)); - EXPECT_CALL(*mock_bus_, + EXPECT_CALL(*mock_bus_.get(), GetObjectProxy(ibus::kDBusServiceName, dbus::ObjectPath(ibus::kDBusObjectPath))) .WillOnce(Return(mock_dbus_proxy.get())); MockGetNameOwnerMethodCallHandler mock_get_name_owner_method_call; - EXPECT_CALL(*mock_dbus_proxy, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_dbus_proxy.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillOnce(Invoke(&mock_get_name_owner_method_call, &MockGetNameOwnerMethodCallHandler::Run)); NameOwnerChangedHandler handler; - EXPECT_CALL(*mock_dbus_proxy, ConnectToSignal( - ibus::kDBusInterface, - ibus::kNameOwnerChangedSignal, - _, - _)).WillOnce(Invoke(&handler, - &NameOwnerChangedHandler::OnConnectToSignal)); + EXPECT_CALL(*mock_dbus_proxy.get(), + ConnectToSignal( + ibus::kDBusInterface, ibus::kNameOwnerChangedSignal, _, _)) + .WillOnce( + Invoke(&handler, &NameOwnerChangedHandler::OnConnectToSignal)); client_->InitializeAsync(base::Bind(&base::DoNothing)); mock_get_name_owner_method_call.EmitReplyCallback(":0.1"); } @@ -340,7 +339,7 @@ TEST_F(IBusConfigClientTest, SetStringValueTest) { InitializeSync(); const char value[] = "value"; SetStringValueHandler handler(kSection, kKey, value, HANDLER_SUCCESS); - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillOnce(Invoke(&handler, &SetValueVerifierBase::Run)); MockErrorCallback error_callback; EXPECT_CALL(error_callback, Run()).Times(0); @@ -356,7 +355,7 @@ TEST_F(IBusConfigClientTest, SetStringValueTest_Fail) { InitializeSync(); const char value[] = "value"; SetStringValueHandler handler(kSection, kKey, value, HANDLER_FAIL); - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillOnce(Invoke(&handler, &SetValueVerifierBase::Run)); MockErrorCallback error_callback; EXPECT_CALL(error_callback, Run()); @@ -372,7 +371,7 @@ TEST_F(IBusConfigClientTest, SetIntValueTest) { InitializeSync(); const int value = 1234; SetIntValueHandler handler(kSection, kKey, value, HANDLER_SUCCESS); - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillOnce(Invoke(&handler, &SetValueVerifierBase::Run)); MockErrorCallback error_callback; EXPECT_CALL(error_callback, Run()).Times(0); @@ -388,7 +387,7 @@ TEST_F(IBusConfigClientTest, SetIntValueTest_Fail) { InitializeSync(); const int value = 1234; SetIntValueHandler handler(kSection, kKey, value, HANDLER_FAIL); - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillOnce(Invoke(&handler, &SetValueVerifierBase::Run)); MockErrorCallback error_callback; EXPECT_CALL(error_callback, Run()); @@ -404,7 +403,7 @@ TEST_F(IBusConfigClientTest, SetBoolValueTest) { InitializeSync(); const bool value = true; SetBoolValueHandler handler(kSection, kKey, value, HANDLER_SUCCESS); - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillOnce(Invoke(&handler, &SetValueVerifierBase::Run)); MockErrorCallback error_callback; EXPECT_CALL(error_callback, Run()).Times(0); @@ -420,7 +419,7 @@ TEST_F(IBusConfigClientTest, SetBoolValueTest_Fail) { InitializeSync(); const bool value = true; SetBoolValueHandler handler(kSection, kKey, value, HANDLER_FAIL); - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillOnce(Invoke(&handler, &SetValueVerifierBase::Run)); MockErrorCallback error_callback; EXPECT_CALL(error_callback, Run()); @@ -439,7 +438,7 @@ TEST_F(IBusConfigClientTest, SetStringListValueTest) { value.push_back("Sample value 2"); SetStringListValueHandler handler(kSection, kKey, value, HANDLER_SUCCESS); - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillOnce(Invoke(&handler, &SetValueVerifierBase::Run)); MockErrorCallback error_callback; EXPECT_CALL(error_callback, Run()).Times(0); @@ -458,7 +457,7 @@ TEST_F(IBusConfigClientTest, SetStringListValueTest_Fail) { value.push_back("Sample value 2"); SetStringListValueHandler handler(kSection, kKey, value, HANDLER_FAIL); - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillOnce(Invoke(&handler, &SetValueVerifierBase::Run)); MockErrorCallback error_callback; EXPECT_CALL(error_callback, Run()); @@ -472,29 +471,27 @@ TEST_F(IBusConfigClientTest, SetStringListValueTest_Fail) { TEST_F(IBusConfigClientTest, IBusConfigDaemon_NotAvailableTest) { MockGetNameOwnerMethodCallHandler mock_get_name_owner_method_call; - EXPECT_CALL(*mock_bus_, GetObjectProxy(ibus::kServiceName, - dbus::ObjectPath( - ibus::config::kServicePath))) + EXPECT_CALL(*mock_bus_.get(), + GetObjectProxy(ibus::kServiceName, + dbus::ObjectPath(ibus::config::kServicePath))) .Times(0); scoped_refptr<dbus::MockObjectProxy> mock_dbus_proxy = new dbus::MockObjectProxy(mock_bus_.get(), ibus::kDBusServiceName, dbus::ObjectPath(ibus::kDBusObjectPath)); - EXPECT_CALL(*mock_bus_, + EXPECT_CALL(*mock_bus_.get(), GetObjectProxy(ibus::kDBusServiceName, dbus::ObjectPath(ibus::kDBusObjectPath))) .WillOnce(Return(mock_dbus_proxy.get())); - EXPECT_CALL(*mock_dbus_proxy, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_dbus_proxy.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillOnce(Invoke(&mock_get_name_owner_method_call, &MockGetNameOwnerMethodCallHandler::Run)); NameOwnerChangedHandler handler; - EXPECT_CALL(*mock_dbus_proxy, ConnectToSignal( - ibus::kDBusInterface, - ibus::kNameOwnerChangedSignal, - _, - _)).WillOnce(Invoke(&handler, - &NameOwnerChangedHandler::OnConnectToSignal)); + EXPECT_CALL(*mock_dbus_proxy.get(), + ConnectToSignal( + ibus::kDBusInterface, ibus::kNameOwnerChangedSignal, _, _)) + .WillOnce(Invoke(&handler, &NameOwnerChangedHandler::OnConnectToSignal)); client_->InitializeAsync(base::Bind(&base::DoNothing)); // Passing empty string means there is no owner, thus ibus-config daemon is @@ -503,7 +500,8 @@ TEST_F(IBusConfigClientTest, IBusConfigDaemon_NotAvailableTest) { // Make sure not crashing by function call without initialize. const bool value = true; - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)).Times(0); + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) + .Times(0); MockErrorCallback error_callback; EXPECT_CALL(error_callback, Run()).Times(0); client_->SetBoolValue(kKey, kSection, value, @@ -514,29 +512,28 @@ TEST_F(IBusConfigClientTest, IBusConfigDaemon_NotAvailableTest) { TEST_F(IBusConfigClientTest, IBusConfigDaemon_SlowInitializeTest) { MockGetNameOwnerMethodCallHandler mock_get_name_owner_method_call; - EXPECT_CALL(*mock_bus_, GetObjectProxy(ibus::config::kServiceName, - dbus::ObjectPath( - ibus::config::kServicePath))) + EXPECT_CALL(*mock_bus_.get(), + GetObjectProxy(ibus::config::kServiceName, + dbus::ObjectPath(ibus::config::kServicePath))) .WillOnce(Return(mock_proxy_.get())); scoped_refptr<dbus::MockObjectProxy> mock_dbus_proxy = new dbus::MockObjectProxy(mock_bus_.get(), ibus::kDBusServiceName, dbus::ObjectPath(ibus::kDBusObjectPath)); - EXPECT_CALL(*mock_bus_, + EXPECT_CALL(*mock_bus_.get(), GetObjectProxy(ibus::kDBusServiceName, dbus::ObjectPath(ibus::kDBusObjectPath))) .WillOnce(Return(mock_dbus_proxy.get())); - EXPECT_CALL(*mock_dbus_proxy, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_dbus_proxy.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillOnce(Invoke(&mock_get_name_owner_method_call, &MockGetNameOwnerMethodCallHandler::Run)); NameOwnerChangedHandler name_owner_changed_handler; - EXPECT_CALL(*mock_dbus_proxy, ConnectToSignal( - ibus::kDBusInterface, - ibus::kNameOwnerChangedSignal, - _, - _)).WillOnce(Invoke(&name_owner_changed_handler, - &NameOwnerChangedHandler::OnConnectToSignal)); + EXPECT_CALL(*mock_dbus_proxy.get(), + ConnectToSignal( + ibus::kDBusInterface, ibus::kNameOwnerChangedSignal, _, _)) + .WillOnce(Invoke(&name_owner_changed_handler, + &NameOwnerChangedHandler::OnConnectToSignal)); client_->InitializeAsync(base::Bind(&base::DoNothing)); // Passing empty string means there is no owner, thus ibus-config daemon is @@ -552,7 +549,7 @@ TEST_F(IBusConfigClientTest, IBusConfigDaemon_SlowInitializeTest) { // Make sure it is possible to emit method calls. const bool value = true; SetBoolValueHandler handler(kSection, kKey, value, HANDLER_FAIL); - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillOnce(Invoke(&handler, &SetValueVerifierBase::Run)); MockErrorCallback error_callback; EXPECT_CALL(error_callback, Run()); @@ -566,34 +563,33 @@ TEST_F(IBusConfigClientTest, IBusConfigDaemon_SlowInitializeTest) { TEST_F(IBusConfigClientTest, IBusConfigDaemon_ShutdownTest) { MockGetNameOwnerMethodCallHandler mock_get_name_owner_method_call; - EXPECT_CALL(*mock_bus_, GetObjectProxy(ibus::config::kServiceName, - dbus::ObjectPath( - ibus::config::kServicePath))) + EXPECT_CALL(*mock_bus_.get(), + GetObjectProxy(ibus::config::kServiceName, + dbus::ObjectPath(ibus::config::kServicePath))) .WillRepeatedly(Return(mock_proxy_.get())); scoped_refptr<dbus::MockObjectProxy> mock_dbus_proxy = new dbus::MockObjectProxy(mock_bus_.get(), ibus::kDBusServiceName, dbus::ObjectPath(ibus::kDBusObjectPath)); - EXPECT_CALL(*mock_bus_, + EXPECT_CALL(*mock_bus_.get(), GetObjectProxy(ibus::kDBusServiceName, dbus::ObjectPath(ibus::kDBusObjectPath))) .WillOnce(Return(mock_dbus_proxy.get())); - EXPECT_CALL(*mock_dbus_proxy, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_dbus_proxy.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillOnce(Invoke(&mock_get_name_owner_method_call, &MockGetNameOwnerMethodCallHandler::Run)); NameOwnerChangedHandler name_owner_changed_handler; - EXPECT_CALL(*mock_dbus_proxy, ConnectToSignal( - ibus::kDBusInterface, - ibus::kNameOwnerChangedSignal, - _, - _)).WillOnce(Invoke(&name_owner_changed_handler, - &NameOwnerChangedHandler::OnConnectToSignal)); + EXPECT_CALL(*mock_dbus_proxy.get(), + ConnectToSignal( + ibus::kDBusInterface, ibus::kNameOwnerChangedSignal, _, _)) + .WillOnce(Invoke(&name_owner_changed_handler, + &NameOwnerChangedHandler::OnConnectToSignal)); client_->InitializeAsync(base::Bind(&base::DoNothing)); const bool value = true; SetBoolValueHandler handler(kSection, kKey, value, HANDLER_FAIL); - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillRepeatedly(Invoke(&handler, &SetValueVerifierBase::Run)); MockErrorCallback error_callback; EXPECT_CALL(error_callback, Run()).WillRepeatedly(Return()); diff --git a/chromeos/dbus/ibus/ibus_engine_factory_service_unittest.cc b/chromeos/dbus/ibus/ibus_engine_factory_service_unittest.cc index 146e01a..80c79cd 100644 --- a/chromeos/dbus/ibus/ibus_engine_factory_service_unittest.cc +++ b/chromeos/dbus/ibus/ibus_engine_factory_service_unittest.cc @@ -94,25 +94,24 @@ class IBusEngineFactoryServiceTest : public testing::Test { mock_bus_.get(), dbus::ObjectPath(ibus::engine_factory::kServicePath)); - EXPECT_CALL(*mock_bus_, - GetExportedObject(dbus::ObjectPath( - ibus::engine_factory::kServicePath))) + EXPECT_CALL( + *mock_bus_.get(), + GetExportedObject(dbus::ObjectPath(ibus::engine_factory::kServicePath))) .WillOnce(Return(mock_exported_object_.get())); - EXPECT_CALL(*mock_bus_, AssertOnOriginThread()) + EXPECT_CALL(*mock_bus_.get(), AssertOnOriginThread()) .WillRepeatedly(Return()); - EXPECT_CALL(*mock_exported_object_, ExportMethod( - ibus::engine_factory::kServiceInterface, - ibus::engine_factory::kCreateEngineMethod, - _, - _)) + EXPECT_CALL(*mock_exported_object_.get(), + ExportMethod(ibus::engine_factory::kServiceInterface, + ibus::engine_factory::kCreateEngineMethod, + _, + _)) .WillRepeatedly( - Invoke(this, &IBusEngineFactoryServiceTest::OnMethodExported)); + Invoke(this, &IBusEngineFactoryServiceTest::OnMethodExported)); service_.reset(IBusEngineFactoryService::Create( - mock_bus_, - REAL_DBUS_CLIENT_IMPLEMENTATION)); + mock_bus_.get(), REAL_DBUS_CLIENT_IMPLEMENTATION)); } protected: diff --git a/chromeos/dbus/ibus/ibus_engine_service_unittest.cc b/chromeos/dbus/ibus/ibus_engine_service_unittest.cc index fc9c05f..ca96ddf 100644 --- a/chromeos/dbus/ibus/ibus_engine_service_unittest.cc +++ b/chromeos/dbus/ibus/ibus_engine_service_unittest.cc @@ -396,77 +396,87 @@ class IBusEngineServiceTest : public testing::Test { GetExportedObject(dbus::ObjectPath(kObjectPath))) .WillOnce(Return(mock_exported_object_.get())); - EXPECT_CALL(*mock_exported_object_, ExportMethod( - ibus::engine::kServiceInterface, - ibus::engine::kFocusInMethod , _, _)) - .WillRepeatedly( - Invoke(this, &IBusEngineServiceTest::OnMethodExported)); - - EXPECT_CALL(*mock_exported_object_, ExportMethod( - ibus::engine::kServiceInterface, - ibus::engine::kFocusOutMethod , _, _)) - .WillRepeatedly( - Invoke(this, &IBusEngineServiceTest::OnMethodExported)); - - EXPECT_CALL(*mock_exported_object_, ExportMethod( - ibus::engine::kServiceInterface, - ibus::engine::kEnableMethod , _, _)) - .WillRepeatedly( - Invoke(this, &IBusEngineServiceTest::OnMethodExported)); - - EXPECT_CALL(*mock_exported_object_, ExportMethod( - ibus::engine::kServiceInterface, - ibus::engine::kDisableMethod , _, _)) - .WillRepeatedly( - Invoke(this, &IBusEngineServiceTest::OnMethodExported)); - - EXPECT_CALL(*mock_exported_object_, ExportMethod( - ibus::engine::kServiceInterface, - ibus::engine::kPropertyActivateMethod , _, _)) - .WillRepeatedly( - Invoke(this, &IBusEngineServiceTest::OnMethodExported)); - - EXPECT_CALL(*mock_exported_object_, ExportMethod( - ibus::engine::kServiceInterface, - ibus::engine::kPropertyShowMethod , _, _)) - .WillRepeatedly( - Invoke(this, &IBusEngineServiceTest::OnMethodExported)); - - EXPECT_CALL(*mock_exported_object_, ExportMethod( - ibus::engine::kServiceInterface, - ibus::engine::kPropertyHideMethod , _, _)) - .WillRepeatedly( - Invoke(this, &IBusEngineServiceTest::OnMethodExported)); - - EXPECT_CALL(*mock_exported_object_, ExportMethod( - ibus::engine::kServiceInterface, - ibus::engine::kSetCapabilityMethod , _, _)) - .WillRepeatedly( - Invoke(this, &IBusEngineServiceTest::OnMethodExported)); - - EXPECT_CALL(*mock_exported_object_, ExportMethod( - ibus::engine::kServiceInterface, - ibus::engine::kResetMethod , _, _)) - .WillRepeatedly( - Invoke(this, &IBusEngineServiceTest::OnMethodExported)); - - EXPECT_CALL(*mock_exported_object_, ExportMethod( - ibus::engine::kServiceInterface, - ibus::engine::kProcessKeyEventMethod , _, _)) - .WillRepeatedly( - Invoke(this, &IBusEngineServiceTest::OnMethodExported)); - - EXPECT_CALL(*mock_exported_object_, ExportMethod( - ibus::engine::kServiceInterface, - ibus::engine::kCandidateClickedMethod , _, _)) - .WillRepeatedly( - Invoke(this, &IBusEngineServiceTest::OnMethodExported)); - - EXPECT_CALL(*mock_exported_object_, ExportMethod( - ibus::engine::kServiceInterface, - ibus::engine::kSetSurroundingTextMethod , _, _)) - .WillRepeatedly( - Invoke(this, &IBusEngineServiceTest::OnMethodExported)); + EXPECT_CALL(*mock_exported_object_.get(), + ExportMethod(ibus::engine::kServiceInterface, + ibus::engine::kFocusInMethod, + _, + _)) + .WillRepeatedly(Invoke(this, &IBusEngineServiceTest::OnMethodExported)); + + EXPECT_CALL(*mock_exported_object_.get(), + ExportMethod(ibus::engine::kServiceInterface, + ibus::engine::kFocusOutMethod, + _, + _)) + .WillRepeatedly(Invoke(this, &IBusEngineServiceTest::OnMethodExported)); + + EXPECT_CALL( + *mock_exported_object_.get(), + ExportMethod( + ibus::engine::kServiceInterface, ibus::engine::kEnableMethod, _, _)) + .WillRepeatedly(Invoke(this, &IBusEngineServiceTest::OnMethodExported)); + + EXPECT_CALL(*mock_exported_object_.get(), + ExportMethod(ibus::engine::kServiceInterface, + ibus::engine::kDisableMethod, + _, + _)) + .WillRepeatedly(Invoke(this, &IBusEngineServiceTest::OnMethodExported)); + + EXPECT_CALL(*mock_exported_object_.get(), + ExportMethod(ibus::engine::kServiceInterface, + ibus::engine::kPropertyActivateMethod, + _, + _)) + .WillRepeatedly(Invoke(this, &IBusEngineServiceTest::OnMethodExported)); + + EXPECT_CALL(*mock_exported_object_.get(), + ExportMethod(ibus::engine::kServiceInterface, + ibus::engine::kPropertyShowMethod, + _, + _)) + .WillRepeatedly(Invoke(this, &IBusEngineServiceTest::OnMethodExported)); + + EXPECT_CALL(*mock_exported_object_.get(), + ExportMethod(ibus::engine::kServiceInterface, + ibus::engine::kPropertyHideMethod, + _, + _)) + .WillRepeatedly(Invoke(this, &IBusEngineServiceTest::OnMethodExported)); + + EXPECT_CALL(*mock_exported_object_.get(), + ExportMethod(ibus::engine::kServiceInterface, + ibus::engine::kSetCapabilityMethod, + _, + _)) + .WillRepeatedly(Invoke(this, &IBusEngineServiceTest::OnMethodExported)); + + EXPECT_CALL( + *mock_exported_object_.get(), + ExportMethod( + ibus::engine::kServiceInterface, ibus::engine::kResetMethod, _, _)) + .WillRepeatedly(Invoke(this, &IBusEngineServiceTest::OnMethodExported)); + + EXPECT_CALL(*mock_exported_object_.get(), + ExportMethod(ibus::engine::kServiceInterface, + ibus::engine::kProcessKeyEventMethod, + _, + _)) + .WillRepeatedly(Invoke(this, &IBusEngineServiceTest::OnMethodExported)); + + EXPECT_CALL(*mock_exported_object_.get(), + ExportMethod(ibus::engine::kServiceInterface, + ibus::engine::kCandidateClickedMethod, + _, + _)) + .WillRepeatedly(Invoke(this, &IBusEngineServiceTest::OnMethodExported)); + + EXPECT_CALL(*mock_exported_object_.get(), + ExportMethod(ibus::engine::kServiceInterface, + ibus::engine::kSetSurroundingTextMethod, + _, + _)) + .WillRepeatedly(Invoke(this, &IBusEngineServiceTest::OnMethodExported)); // Suppress uninteresting mock function call warning. EXPECT_CALL(*mock_bus_.get(), @@ -1021,9 +1031,8 @@ TEST_F(IBusEngineServiceTest, RegisterProperties) { property_list[0]->set_checked(true); RegisterPropertiesExpectation expectation(property_list); - EXPECT_CALL(*mock_exported_object_, SendSignal(_)) - .WillOnce(Invoke(&expectation, - &RegisterPropertiesExpectation::Evaluate)); + EXPECT_CALL(*mock_exported_object_.get(), SendSignal(_)) + .WillOnce(Invoke(&expectation, &RegisterPropertiesExpectation::Evaluate)); // Emit signal. service_->RegisterProperties(property_list); } @@ -1038,7 +1047,7 @@ TEST_F(IBusEngineServiceTest, UpdatePreeditTest) { IBusEngineService::IBUS_ENGINE_PREEEDIT_FOCUS_OUT_MODE_CLEAR; UpdatePreeditExpectation expectation(ibus_text, kCursorPos, kIsVisible, kPreeditMode); - EXPECT_CALL(*mock_exported_object_, SendSignal(_)) + EXPECT_CALL(*mock_exported_object_.get(), SendSignal(_)) .WillOnce(Invoke(&expectation, &UpdatePreeditExpectation::Evaluate)); // Emit signal. @@ -1051,9 +1060,8 @@ TEST_F(IBusEngineServiceTest, UpdateAuxiliaryText) { const bool kIsVisible = false; UpdateAuxiliaryTextExpectation expectation(ibus_text, kIsVisible); - EXPECT_CALL(*mock_exported_object_, SendSignal(_)) - .WillOnce(Invoke(&expectation, - &UpdateAuxiliaryTextExpectation::Evaluate)); + EXPECT_CALL(*mock_exported_object_.get(), SendSignal(_)).WillOnce( + Invoke(&expectation, &UpdateAuxiliaryTextExpectation::Evaluate)); // Emit signal. service_->UpdateAuxiliaryText(ibus_text, kIsVisible); @@ -1067,9 +1075,8 @@ TEST_F(IBusEngineServiceTest, UpdateLookupTableTest) { const bool kIsVisible = true; UpdateLookupTableExpectation expectation(lookup_table, kIsVisible); - EXPECT_CALL(*mock_exported_object_, SendSignal(_)) - .WillOnce(Invoke(&expectation, - &UpdateLookupTableExpectation::Evaluate)); + EXPECT_CALL(*mock_exported_object_.get(), SendSignal(_)) + .WillOnce(Invoke(&expectation, &UpdateLookupTableExpectation::Evaluate)); // Emit signal. service_->UpdateLookupTable(lookup_table, kIsVisible); @@ -1085,9 +1092,8 @@ TEST_F(IBusEngineServiceTest, UpdatePropertyTest) { property.set_checked(true); UpdatePropertyExpectation expectation(property); - EXPECT_CALL(*mock_exported_object_, SendSignal(_)) - .WillOnce(Invoke(&expectation, - &UpdatePropertyExpectation::Evaluate)); + EXPECT_CALL(*mock_exported_object_.get(), SendSignal(_)) + .WillOnce(Invoke(&expectation, &UpdatePropertyExpectation::Evaluate)); // Emit signal. service_->UpdateProperty(property); @@ -1100,9 +1106,8 @@ TEST_F(IBusEngineServiceTest, ForwardKeyEventTest) { ForwardKeyEventExpectation expectation(keyval, keycode, state); - EXPECT_CALL(*mock_exported_object_, SendSignal(_)) - .WillOnce(Invoke(&expectation, - &ForwardKeyEventExpectation::Evaluate)); + EXPECT_CALL(*mock_exported_object_.get(), SendSignal(_)) + .WillOnce(Invoke(&expectation, &ForwardKeyEventExpectation::Evaluate)); // Emit signal. service_->ForwardKeyEvent(keyval, keycode, state); @@ -1110,9 +1115,8 @@ TEST_F(IBusEngineServiceTest, ForwardKeyEventTest) { TEST_F(IBusEngineServiceTest, RequireSurroundingTextTest) { RequireSurroundingTextExpectation expectation; - EXPECT_CALL(*mock_exported_object_, SendSignal(_)) - .WillOnce(Invoke(&expectation, - &RequireSurroundingTextExpectation::Evaluate)); + EXPECT_CALL(*mock_exported_object_.get(), SendSignal(_)).WillOnce( + Invoke(&expectation, &RequireSurroundingTextExpectation::Evaluate)); // Emit signal. service_->RequireSurroundingText(); diff --git a/chromeos/dbus/ibus/ibus_input_context_client_unittest.cc b/chromeos/dbus/ibus/ibus_input_context_client_unittest.cc index d8b4e2d..457be17 100644 --- a/chromeos/dbus/ibus/ibus_input_context_client_unittest.cc +++ b/chromeos/dbus/ibus/ibus_input_context_client_unittest.cc @@ -101,43 +101,57 @@ class IBusInputContextClientTest : public testing::Test { // Set an expectation so mock_bus's GetObjectProxy() for the given service // name and the object path will return mock_proxy_. The GetObjectProxy // function is called in Initialized function. - EXPECT_CALL(*mock_bus_, GetObjectProxy(ibus::kServiceName, - dbus::ObjectPath(kObjectPath))) + EXPECT_CALL( + *mock_bus_.get(), + GetObjectProxy(ibus::kServiceName, dbus::ObjectPath(kObjectPath))) .WillOnce(Return(mock_proxy_.get())); // Set expectations so mock_proxy's ConnectToSignal will use // OnConnectToSignal() to run the callback. The ConnectToSignal is called in // Initialize function. - EXPECT_CALL(*mock_proxy_, ConnectToSignal( - ibus::input_context::kServiceInterface, - ibus::input_context::kCommitTextSignal, _, _)) + EXPECT_CALL(*mock_proxy_.get(), + ConnectToSignal(ibus::input_context::kServiceInterface, + ibus::input_context::kCommitTextSignal, + _, + _)) .WillRepeatedly( - Invoke(this, &IBusInputContextClientTest::OnConnectToSignal)); - EXPECT_CALL(*mock_proxy_, ConnectToSignal( - ibus::input_context::kServiceInterface, - ibus::input_context::kForwardKeyEventSignal, _, _)) + Invoke(this, &IBusInputContextClientTest::OnConnectToSignal)); + EXPECT_CALL(*mock_proxy_.get(), + ConnectToSignal(ibus::input_context::kServiceInterface, + ibus::input_context::kForwardKeyEventSignal, + _, + _)) .WillRepeatedly( - Invoke(this, &IBusInputContextClientTest::OnConnectToSignal)); - EXPECT_CALL(*mock_proxy_, ConnectToSignal( - ibus::input_context::kServiceInterface, - ibus::input_context::kHidePreeditTextSignal, _, _)) + Invoke(this, &IBusInputContextClientTest::OnConnectToSignal)); + EXPECT_CALL(*mock_proxy_.get(), + ConnectToSignal(ibus::input_context::kServiceInterface, + ibus::input_context::kHidePreeditTextSignal, + _, + _)) .WillRepeatedly( - Invoke(this, &IBusInputContextClientTest::OnConnectToSignal)); - EXPECT_CALL(*mock_proxy_, ConnectToSignal( - ibus::input_context::kServiceInterface, - ibus::input_context::kShowPreeditTextSignal, _, _)) + Invoke(this, &IBusInputContextClientTest::OnConnectToSignal)); + EXPECT_CALL(*mock_proxy_.get(), + ConnectToSignal(ibus::input_context::kServiceInterface, + ibus::input_context::kShowPreeditTextSignal, + _, + _)) .WillRepeatedly( - Invoke(this, &IBusInputContextClientTest::OnConnectToSignal)); - EXPECT_CALL(*mock_proxy_, ConnectToSignal( - ibus::input_context::kServiceInterface, - ibus::input_context::kUpdatePreeditTextSignal, _, _)) + Invoke(this, &IBusInputContextClientTest::OnConnectToSignal)); + EXPECT_CALL(*mock_proxy_.get(), + ConnectToSignal(ibus::input_context::kServiceInterface, + ibus::input_context::kUpdatePreeditTextSignal, + _, + _)) .WillRepeatedly( - Invoke(this, &IBusInputContextClientTest::OnConnectToSignal)); - EXPECT_CALL(*mock_proxy_, ConnectToSignal( - ibus::input_context::kServiceInterface, - ibus::input_context::kDeleteSurroundingTextSignal, _, _)) + Invoke(this, &IBusInputContextClientTest::OnConnectToSignal)); + EXPECT_CALL( + *mock_proxy_.get(), + ConnectToSignal(ibus::input_context::kServiceInterface, + ibus::input_context::kDeleteSurroundingTextSignal, + _, + _)) .WillRepeatedly( - Invoke(this, &IBusInputContextClientTest::OnConnectToSignal)); + Invoke(this, &IBusInputContextClientTest::OnConnectToSignal)); // Call Initialize to create object proxy and connect signals. client_->Initialize(mock_bus_.get(), dbus::ObjectPath(kObjectPath)); @@ -470,7 +484,7 @@ TEST_F(IBusInputContextClientTest, UpdatePreeditTextHandlerTest) { TEST_F(IBusInputContextClientTest, FocusInTest) { // Set expectations. - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillOnce(Invoke(this, &IBusInputContextClientTest::OnFocusIn)); // Create response. scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty()); @@ -484,7 +498,7 @@ TEST_F(IBusInputContextClientTest, FocusInTest) { TEST_F(IBusInputContextClientTest, FocusOutTest) { // Set expectations. - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillOnce(Invoke(this, &IBusInputContextClientTest::OnFocusOut)); // Create response. scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty()); @@ -498,7 +512,7 @@ TEST_F(IBusInputContextClientTest, FocusOutTest) { TEST_F(IBusInputContextClientTest, ResetTest) { // Set expectations. - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillOnce(Invoke(this, &IBusInputContextClientTest::OnReset)); // Create response. scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty()); @@ -512,7 +526,7 @@ TEST_F(IBusInputContextClientTest, ResetTest) { TEST_F(IBusInputContextClientTest, SetCapabilitiesTest) { // Set expectations. - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillOnce(Invoke(this, &IBusInputContextClientTest::OnSetCapabilities)); // Create response. scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty()); @@ -546,7 +560,7 @@ TEST_F(IBusInputContextClientTest, SetCursorLocationTest) { TEST_F(IBusInputContextClientTest, OnProcessKeyEvent) { // Set expectations. - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillOnce(Invoke(this, &IBusInputContextClientTest::OnProcessKeyEvent)); MockProcessKeyEventHandler callback; MockProcessKeyEventErrorHandler error_callback; @@ -573,9 +587,9 @@ TEST_F(IBusInputContextClientTest, OnProcessKeyEvent) { TEST_F(IBusInputContextClientTest, OnProcessKeyEventFail) { // Set expectations. - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) - .WillOnce(Invoke(this, - &IBusInputContextClientTest::OnProcessKeyEventFail)); + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) + .WillOnce( + Invoke(this, &IBusInputContextClientTest::OnProcessKeyEventFail)); MockProcessKeyEventHandler callback; MockProcessKeyEventErrorHandler error_callback; @@ -601,9 +615,9 @@ TEST_F(IBusInputContextClientTest, OnProcessKeyEventFail) { TEST_F(IBusInputContextClientTest, SetSurroundingTextTest) { // Set expectations. - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) - .WillOnce(Invoke(this, - &IBusInputContextClientTest::OnSetSurroundingText)); + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) + .WillOnce( + Invoke(this, &IBusInputContextClientTest::OnSetSurroundingText)); // Create response. scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty()); response_ = response.get(); @@ -616,9 +630,8 @@ TEST_F(IBusInputContextClientTest, SetSurroundingTextTest) { TEST_F(IBusInputContextClientTest, PropertyActivateTest) { // Set expectations. - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) - .WillOnce(Invoke(this, - &IBusInputContextClientTest::OnPropertyActivate)); + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) + .WillOnce(Invoke(this, &IBusInputContextClientTest::OnPropertyActivate)); // Create response. scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty()); response_ = response.get(); diff --git a/chromeos/dbus/ibus/ibus_panel_service_unittest.cc b/chromeos/dbus/ibus/ibus_panel_service_unittest.cc index ec7aa74..66ee748 100644 --- a/chromeos/dbus/ibus/ibus_panel_service_unittest.cc +++ b/chromeos/dbus/ibus/ibus_panel_service_unittest.cc @@ -223,71 +223,80 @@ class IBusPanelServiceTest : public testing::Test { ibus::panel::kServicePath))) .WillOnce(Return(mock_exported_object_.get())); - EXPECT_CALL(*mock_exported_object_, ExportMethod( - ibus::panel::kServiceInterface, - ibus::panel::kUpdateLookupTableMethod, _, _)) - .WillRepeatedly( - Invoke(this, &IBusPanelServiceTest::OnMethodExported)); - - EXPECT_CALL(*mock_exported_object_, ExportMethod( - ibus::panel::kServiceInterface, - ibus::panel::kHideLookupTableMethod, _, _)) - .WillRepeatedly( - Invoke(this, &IBusPanelServiceTest::OnMethodExported)); - - EXPECT_CALL(*mock_exported_object_, ExportMethod( - ibus::panel::kServiceInterface, - ibus::panel::kUpdateAuxiliaryTextMethod, _, _)) - .WillRepeatedly( - Invoke(this, &IBusPanelServiceTest::OnMethodExported)); - - EXPECT_CALL(*mock_exported_object_, ExportMethod( - ibus::panel::kServiceInterface, - ibus::panel::kHideAuxiliaryTextMethod, _, _)) - .WillRepeatedly( - Invoke(this, &IBusPanelServiceTest::OnMethodExported)); - - EXPECT_CALL(*mock_exported_object_, ExportMethod( - ibus::panel::kServiceInterface, - ibus::panel::kUpdatePreeditTextMethod, _, _)) - .WillRepeatedly( - Invoke(this, &IBusPanelServiceTest::OnMethodExported)); - - EXPECT_CALL(*mock_exported_object_, ExportMethod( - ibus::panel::kServiceInterface, - ibus::panel::kHidePreeditTextMethod, _, _)) - .WillRepeatedly( - Invoke(this, &IBusPanelServiceTest::OnMethodExported)); - - EXPECT_CALL(*mock_exported_object_, ExportMethod( - ibus::panel::kServiceInterface, - ibus::panel::kRegisterPropertiesMethod, _, _)) - .WillRepeatedly( - Invoke(this, &IBusPanelServiceTest::OnMethodExported)); - - EXPECT_CALL(*mock_exported_object_, ExportMethod( - ibus::panel::kServiceInterface, - ibus::panel::kUpdatePropertyMethod, _, _)) - .WillRepeatedly( - Invoke(this, &IBusPanelServiceTest::OnMethodExported)); - - EXPECT_CALL(*mock_exported_object_, ExportMethod( - ibus::panel::kServiceInterface, - ibus::panel::kFocusInMethod, _, _)) - .WillRepeatedly( - Invoke(this, &IBusPanelServiceTest::OnMethodExported)); - - EXPECT_CALL(*mock_exported_object_, ExportMethod( - ibus::panel::kServiceInterface, - ibus::panel::kFocusOutMethod, _, _)) - .WillRepeatedly( - Invoke(this, &IBusPanelServiceTest::OnMethodExported)); - - EXPECT_CALL(*mock_exported_object_, ExportMethod( - ibus::panel::kServiceInterface, - ibus::panel::kStateChangedMethod, _, _)) - .WillRepeatedly( - Invoke(this, &IBusPanelServiceTest::OnMethodExported)); + EXPECT_CALL(*mock_exported_object_.get(), + ExportMethod(ibus::panel::kServiceInterface, + ibus::panel::kUpdateLookupTableMethod, + _, + _)) + .WillRepeatedly(Invoke(this, &IBusPanelServiceTest::OnMethodExported)); + + EXPECT_CALL(*mock_exported_object_.get(), + ExportMethod(ibus::panel::kServiceInterface, + ibus::panel::kHideLookupTableMethod, + _, + _)) + .WillRepeatedly(Invoke(this, &IBusPanelServiceTest::OnMethodExported)); + + EXPECT_CALL(*mock_exported_object_.get(), + ExportMethod(ibus::panel::kServiceInterface, + ibus::panel::kUpdateAuxiliaryTextMethod, + _, + _)) + .WillRepeatedly(Invoke(this, &IBusPanelServiceTest::OnMethodExported)); + + EXPECT_CALL(*mock_exported_object_.get(), + ExportMethod(ibus::panel::kServiceInterface, + ibus::panel::kHideAuxiliaryTextMethod, + _, + _)) + .WillRepeatedly(Invoke(this, &IBusPanelServiceTest::OnMethodExported)); + + EXPECT_CALL(*mock_exported_object_.get(), + ExportMethod(ibus::panel::kServiceInterface, + ibus::panel::kUpdatePreeditTextMethod, + _, + _)) + .WillRepeatedly(Invoke(this, &IBusPanelServiceTest::OnMethodExported)); + + EXPECT_CALL(*mock_exported_object_.get(), + ExportMethod(ibus::panel::kServiceInterface, + ibus::panel::kHidePreeditTextMethod, + _, + _)) + .WillRepeatedly(Invoke(this, &IBusPanelServiceTest::OnMethodExported)); + + EXPECT_CALL(*mock_exported_object_.get(), + ExportMethod(ibus::panel::kServiceInterface, + ibus::panel::kRegisterPropertiesMethod, + _, + _)) + .WillRepeatedly(Invoke(this, &IBusPanelServiceTest::OnMethodExported)); + + EXPECT_CALL(*mock_exported_object_.get(), + ExportMethod(ibus::panel::kServiceInterface, + ibus::panel::kUpdatePropertyMethod, + _, + _)) + .WillRepeatedly(Invoke(this, &IBusPanelServiceTest::OnMethodExported)); + + EXPECT_CALL( + *mock_exported_object_.get(), + ExportMethod( + ibus::panel::kServiceInterface, ibus::panel::kFocusInMethod, _, _)) + .WillRepeatedly(Invoke(this, &IBusPanelServiceTest::OnMethodExported)); + + EXPECT_CALL( + *mock_exported_object_.get(), + ExportMethod( + ibus::panel::kServiceInterface, ibus::panel::kFocusOutMethod, _, _)) + .WillRepeatedly(Invoke(this, &IBusPanelServiceTest::OnMethodExported)); + + EXPECT_CALL(*mock_exported_object_.get(), + ExportMethod(ibus::panel::kServiceInterface, + ibus::panel::kStateChangedMethod, + _, + _)) + .WillRepeatedly(Invoke(this, &IBusPanelServiceTest::OnMethodExported)); // Suppress uninteresting mock function call warning. EXPECT_CALL(*mock_bus_.get(), @@ -520,7 +529,7 @@ TEST_F(IBusPanelServiceTest, UpdatePreeditTextTest) { TEST_F(IBusPanelServiceTest, CursorUpTest) { // Set expectations. NullArgumentVerifier evaluator(ibus::panel::kCursorUpSignal); - EXPECT_CALL(*mock_exported_object_, SendSignal(_)) + EXPECT_CALL(*mock_exported_object_.get(), SendSignal(_)) .WillOnce(Invoke(&evaluator, &NullArgumentVerifier::Verify)); // Emit signal. @@ -530,7 +539,7 @@ TEST_F(IBusPanelServiceTest, CursorUpTest) { TEST_F(IBusPanelServiceTest, CursorDownTest) { // Set expectations. NullArgumentVerifier evaluator(ibus::panel::kCursorDownSignal); - EXPECT_CALL(*mock_exported_object_, SendSignal(_)) + EXPECT_CALL(*mock_exported_object_.get(), SendSignal(_)) .WillOnce(Invoke(&evaluator, &NullArgumentVerifier::Verify)); // Emit signal. @@ -540,7 +549,7 @@ TEST_F(IBusPanelServiceTest, CursorDownTest) { TEST_F(IBusPanelServiceTest, PageUpTest) { // Set expectations. NullArgumentVerifier evaluator(ibus::panel::kPageUpSignal); - EXPECT_CALL(*mock_exported_object_, SendSignal(_)) + EXPECT_CALL(*mock_exported_object_.get(), SendSignal(_)) .WillOnce(Invoke(&evaluator, &NullArgumentVerifier::Verify)); // Emit signal. @@ -550,7 +559,7 @@ TEST_F(IBusPanelServiceTest, PageUpTest) { TEST_F(IBusPanelServiceTest, PageDownTest) { // Set expectations. NullArgumentVerifier evaluator(ibus::panel::kPageDownSignal); - EXPECT_CALL(*mock_exported_object_, SendSignal(_)) + EXPECT_CALL(*mock_exported_object_.get(), SendSignal(_)) .WillOnce(Invoke(&evaluator, &NullArgumentVerifier::Verify)); // Emit signal. diff --git a/chromeos/dbus/modem_messaging_client_unittest.cc b/chromeos/dbus/modem_messaging_client_unittest.cc index 9bb6115..7c14fe6 100644 --- a/chromeos/dbus/modem_messaging_client_unittest.cc +++ b/chromeos/dbus/modem_messaging_client_unittest.cc @@ -75,24 +75,26 @@ class ModemMessagingClientTest : public testing::Test { // Set an expectation so mock_proxy's ConnectToSignal() will use // OnConnectToSignal() to run the callback. - EXPECT_CALL(*mock_proxy_, ConnectToSignal( - modemmanager::kModemManager1MessagingInterface, - modemmanager::kSMSAddedSignal, _, _)) + EXPECT_CALL(*mock_proxy_.get(), + ConnectToSignal(modemmanager::kModemManager1MessagingInterface, + modemmanager::kSMSAddedSignal, + _, + _)) .WillRepeatedly( - Invoke(this, &ModemMessagingClientTest::OnConnectToSignal)); + Invoke(this, &ModemMessagingClientTest::OnConnectToSignal)); // Set an expectation so mock_bus's GetObjectProxy() for the given // service name and the object path will return mock_proxy_. - EXPECT_CALL(*mock_bus_, GetObjectProxy(kServiceName, - dbus::ObjectPath(kObjectPath))) + EXPECT_CALL(*mock_bus_.get(), + GetObjectProxy(kServiceName, dbus::ObjectPath(kObjectPath))) .WillOnce(Return(mock_proxy_.get())); // ShutdownAndBlock() will be called in TearDown(). - EXPECT_CALL(*mock_bus_, ShutdownAndBlock()).WillOnce(Return()); + EXPECT_CALL(*mock_bus_.get(), ShutdownAndBlock()).WillOnce(Return()); // Create a client with the mock bus. client_.reset(ModemMessagingClient::Create(REAL_DBUS_CLIENT_IMPLEMENTATION, - mock_bus_)); + mock_bus_.get())); } virtual void TearDown() OVERRIDE { @@ -199,7 +201,7 @@ TEST_F(ModemMessagingClientTest, Delete) { // Set expectations. const dbus::ObjectPath kSmsPath("/SMS/0"); expected_sms_path_ = kSmsPath; - EXPECT_CALL(*mock_proxy_, CallMethod(_, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethod(_, _, _)) .WillOnce(Invoke(this, &ModemMessagingClientTest::OnDelete)); MockDeleteCallback callback; EXPECT_CALL(callback, Run()).Times(1); @@ -217,7 +219,7 @@ TEST_F(ModemMessagingClientTest, Delete) { TEST_F(ModemMessagingClientTest, List) { // Set expectations. - EXPECT_CALL(*mock_proxy_, CallMethod(_, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethod(_, _, _)) .WillOnce(Invoke(this, &ModemMessagingClientTest::OnList)); MockListCallback callback; EXPECT_CALL(callback, Run(_)) diff --git a/chromeos/dbus/shill_client_unittest_base.cc b/chromeos/dbus/shill_client_unittest_base.cc index 1fa9b7f..9f52614 100644 --- a/chromeos/dbus/shill_client_unittest_base.cc +++ b/chromeos/dbus/shill_client_unittest_base.cc @@ -115,42 +115,41 @@ void ShillClientUnittestBase::SetUp() { // Set an expectation so mock_proxy's CallMethodAndBlock() will use // OnCallMethodAndBlock() to return responses. - EXPECT_CALL(*mock_proxy_, MockCallMethodAndBlock(_, _)) - .WillRepeatedly(Invoke( - this, &ShillClientUnittestBase::OnCallMethodAndBlock)); + EXPECT_CALL(*mock_proxy_.get(), MockCallMethodAndBlock(_, _)).WillRepeatedly( + Invoke(this, &ShillClientUnittestBase::OnCallMethodAndBlock)); // Set an expectation so mock_proxy's CallMethod() will use OnCallMethod() // to return responses. - EXPECT_CALL(*mock_proxy_, CallMethod(_, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethod(_, _, _)) .WillRepeatedly(Invoke(this, &ShillClientUnittestBase::OnCallMethod)); // Set an expectation so mock_proxy's CallMethodWithErrorCallback() will use // OnCallMethodWithErrorCallback() to return responses. - EXPECT_CALL(*mock_proxy_, CallMethodWithErrorCallback(_, _, _, _)) + EXPECT_CALL(*mock_proxy_.get(), CallMethodWithErrorCallback(_, _, _, _)) .WillRepeatedly(Invoke( - this, &ShillClientUnittestBase::OnCallMethodWithErrorCallback)); + this, &ShillClientUnittestBase::OnCallMethodWithErrorCallback)); // Set an expectation so mock_proxy's ConnectToSignal() will use // OnConnectToSignal() to run the callback. - EXPECT_CALL(*mock_proxy_, ConnectToSignal( - interface_name_, - flimflam::kMonitorPropertyChanged, _, _)) - .WillRepeatedly(Invoke(this, - &ShillClientUnittestBase::OnConnectToSignal)); + EXPECT_CALL( + *mock_proxy_.get(), + ConnectToSignal(interface_name_, flimflam::kMonitorPropertyChanged, _, _)) + .WillRepeatedly( + Invoke(this, &ShillClientUnittestBase::OnConnectToSignal)); // Set an expectation so mock_bus's GetObjectProxy() for the given // service name and the object path will return mock_proxy_. - EXPECT_CALL(*mock_bus_, GetObjectProxy(flimflam::kFlimflamServiceName, - object_path_)) + EXPECT_CALL(*mock_bus_.get(), + GetObjectProxy(flimflam::kFlimflamServiceName, object_path_)) .WillOnce(Return(mock_proxy_.get())); // Set an expectation so mock_bus's PostTaskToDBusThread() will run the // given task. - EXPECT_CALL(*mock_bus_, PostTaskToDBusThread(_, _)) + EXPECT_CALL(*mock_bus_.get(), PostTaskToDBusThread(_, _)) .WillRepeatedly(Invoke(&RunTask)); // ShutdownAndBlock() will be called in TearDown(). - EXPECT_CALL(*mock_bus_, ShutdownAndBlock()).WillOnce(Return()); + EXPECT_CALL(*mock_bus_.get(), ShutdownAndBlock()).WillOnce(Return()); } void ShillClientUnittestBase::TearDown() { diff --git a/chromeos/dbus/shill_device_client_unittest.cc b/chromeos/dbus/shill_device_client_unittest.cc index d8f127a..b6c25b5 100644 --- a/chromeos/dbus/shill_device_client_unittest.cc +++ b/chromeos/dbus/shill_device_client_unittest.cc @@ -60,7 +60,7 @@ class ShillDeviceClientTest : public ShillClientUnittestBase { ShillClientUnittestBase::SetUp(); // Create a client with the mock bus. client_.reset(ShillDeviceClient::Create(REAL_DBUS_CLIENT_IMPLEMENTATION, - mock_bus_)); + mock_bus_.get())); // Run the message loop to run the signal connection result callback. message_loop_.RunUntilIdle(); } diff --git a/chromeos/dbus/shill_ipconfig_client_unittest.cc b/chromeos/dbus/shill_ipconfig_client_unittest.cc index bb734fd..424935f 100644 --- a/chromeos/dbus/shill_ipconfig_client_unittest.cc +++ b/chromeos/dbus/shill_ipconfig_client_unittest.cc @@ -33,8 +33,8 @@ class ShillIPConfigClientTest : public ShillClientUnittestBase { virtual void SetUp() { ShillClientUnittestBase::SetUp(); // Create a client with the mock bus. - client_.reset(ShillIPConfigClient::Create( - REAL_DBUS_CLIENT_IMPLEMENTATION, mock_bus_)); + client_.reset(ShillIPConfigClient::Create(REAL_DBUS_CLIENT_IMPLEMENTATION, + mock_bus_.get())); // Run the message loop to run the signal connection result callback. message_loop_.RunUntilIdle(); } diff --git a/chromeos/dbus/shill_manager_client_unittest.cc b/chromeos/dbus/shill_manager_client_unittest.cc index 2021337..ad5b6a0 100644 --- a/chromeos/dbus/shill_manager_client_unittest.cc +++ b/chromeos/dbus/shill_manager_client_unittest.cc @@ -139,7 +139,7 @@ class ShillManagerClientTest : public ShillClientUnittestBase { ShillClientUnittestBase::SetUp(); // Create a client with the mock bus. client_.reset(ShillManagerClient::Create(REAL_DBUS_CLIENT_IMPLEMENTATION, - mock_bus_)); + mock_bus_.get())); // Run the message loop to run the signal connection result callback. message_loop_.RunUntilIdle(); } diff --git a/chromeos/dbus/shill_profile_client_unittest.cc b/chromeos/dbus/shill_profile_client_unittest.cc index fa02ef9..d95b62b 100644 --- a/chromeos/dbus/shill_profile_client_unittest.cc +++ b/chromeos/dbus/shill_profile_client_unittest.cc @@ -42,7 +42,7 @@ class ShillProfileClientTest : public ShillClientUnittestBase { ShillClientUnittestBase::SetUp(); // Create a client with the mock bus. client_.reset(ShillProfileClient::Create(REAL_DBUS_CLIENT_IMPLEMENTATION, - mock_bus_)); + mock_bus_.get())); // Run the message loop to run the signal connection result callback. message_loop_.RunUntilIdle(); } diff --git a/chromeos/dbus/shill_service_client_unittest.cc b/chromeos/dbus/shill_service_client_unittest.cc index 736c215..d4d3bd7 100644 --- a/chromeos/dbus/shill_service_client_unittest.cc +++ b/chromeos/dbus/shill_service_client_unittest.cc @@ -34,7 +34,7 @@ class ShillServiceClientTest : public ShillClientUnittestBase { ShillClientUnittestBase::SetUp(); // Create a client with the mock bus. client_.reset(ShillServiceClient::Create(REAL_DBUS_CLIENT_IMPLEMENTATION, - mock_bus_)); + mock_bus_.get())); // Run the message loop to run the signal connection result callback. message_loop_.RunUntilIdle(); } diff --git a/chromeos/network/onc/onc_certificate_importer_unittest.cc b/chromeos/network/onc/onc_certificate_importer_unittest.cc index c80916a..7713f55 100644 --- a/chromeos/network/onc/onc_certificate_importer_unittest.cc +++ b/chromeos/network/onc/onc_certificate_importer_unittest.cc @@ -140,7 +140,8 @@ class ONCCertificateImporterTest : public testing::Test { bool ok = true; net::CertificateList certs = ListCertsInSlot(); for (size_t i = 0; i < certs.size(); ++i) { - if (!net::NSSCertDatabase::GetInstance()->DeleteCertAndKey(certs[i])) + if (!net::NSSCertDatabase::GetInstance()->DeleteCertAndKey(certs[i] + .get())) ok = false; } return ok; diff --git a/chromeos/process_proxy/process_proxy.cc b/chromeos/process_proxy/process_proxy.cc index 3f67671..990e736 100644 --- a/chromeos/process_proxy/process_proxy.cc +++ b/chromeos/process_proxy/process_proxy.cc @@ -105,7 +105,7 @@ bool ProcessProxy::StartWatchingOnThread( void ProcessProxy::OnProcessOutput(ProcessOutputType type, const std::string& output) { - if (!callback_runner_) + if (!callback_runner_.get()) return; callback_runner_->PostTask( |