Chromium Code Reviews| Index: chromeos/dbus/flimflam_client_unittest_base.cc |
| diff --git a/chromeos/dbus/flimflam_client_unittest_base.cc b/chromeos/dbus/flimflam_client_unittest_base.cc |
| index 57549bc81de211f8101d7c94e23d19171a697219..5d1f3bd637d4b3619c3569815e760347b5dd15db 100644 |
| --- a/chromeos/dbus/flimflam_client_unittest_base.cc |
| +++ b/chromeos/dbus/flimflam_client_unittest_base.cc |
| @@ -5,6 +5,7 @@ |
| #include "chromeos/dbus/flimflam_client_unittest_base.h" |
| #include "base/bind.h" |
| +#include "base/json/json_writer.h" |
| #include "dbus/message.h" |
| #include "dbus/object_path.h" |
| #include "dbus/values_util.h" |
| @@ -19,7 +20,9 @@ using ::testing::Return; |
| namespace chromeos { |
| FlimflamClientUnittestBase::FlimflamClientUnittestBase( |
| - const std::string& interface_name) : interface_name_(interface_name) { |
| + const std::string& interface_name, |
| + const dbus::ObjectPath& object_path) : interface_name_(interface_name), |
|
stevenjb
2012/04/12 17:38:30
nit: newline and indent before ':'
hashimoto
2012/04/13 06:31:14
Done.
|
| + object_path_(object_path) { |
| } |
| FlimflamClientUnittestBase::~FlimflamClientUnittestBase() { |
| @@ -35,7 +38,7 @@ void FlimflamClientUnittestBase::SetUp() { |
| mock_proxy_ = new dbus::MockObjectProxy( |
| mock_bus_.get(), |
| flimflam::kFlimflamServiceName, |
| - dbus::ObjectPath(flimflam::kFlimflamServicePath)); |
| + object_path_); |
| // Set an expectation so mock_proxy's CallMethod() will use OnCallMethod() |
| // to return responses. |
| @@ -52,9 +55,8 @@ void FlimflamClientUnittestBase::SetUp() { |
| // 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, |
| - dbus::ObjectPath(flimflam::kFlimflamServicePath))) |
| + EXPECT_CALL(*mock_bus_, GetObjectProxy(flimflam::kFlimflamServiceName, |
| + object_path_)) |
| .WillOnce(Return(mock_proxy_.get())); |
| // ShutdownAndBlock() will be called in TearDown(). |
| @@ -150,7 +152,11 @@ void FlimflamClientUnittestBase::ExpectDictionaryValueResult( |
| DBusMethodCallStatus call_status, |
| const base::DictionaryValue& result) { |
| EXPECT_EQ(DBUS_METHOD_CALL_SUCCESS, call_status); |
| - EXPECT_TRUE(expected_result->Equals(&result)); |
| + std::string expected_result_string; |
| + base::JSONWriter::Write(expected_result, &expected_result_string); |
| + std::string result_string; |
| + base::JSONWriter::Write(&result, &result_string); |
| + EXPECT_EQ(expected_result_string, result_string); |
| } |
| void FlimflamClientUnittestBase::OnConnectToSignal( |