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

Unified Diff: chromeos/dbus/ibus/ibus_input_context_client_unittest.cc

Issue 16998003: Update CrOS to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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
Index: chromeos/dbus/ibus/ibus_input_context_client_unittest.cc
diff --git a/chromeos/dbus/ibus/ibus_input_context_client_unittest.cc b/chromeos/dbus/ibus/ibus_input_context_client_unittest.cc
index d8b4e2db65a2abd3d004f96d3011bfe1096ba608..457be172bed313760229725e7f1cbb98394b81dc 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();
« no previous file with comments | « chromeos/dbus/ibus/ibus_engine_service_unittest.cc ('k') | chromeos/dbus/ibus/ibus_panel_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698