Chromium Code Reviews| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/values.h" | 6 #include "base/values.h" |
| 7 #include "chromeos/dbus/shill_client_unittest_base.h" | 7 #include "chromeos/dbus/shill_client_unittest_base.h" |
| 8 #include "chromeos/dbus/shill_service_client.h" | 8 #include "chromeos/dbus/shill_service_client.h" |
| 9 #include "dbus/message.h" | 9 #include "dbus/message.h" |
| 10 #include "dbus/object_path.h" | 10 #include "dbus/object_path.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 137 // Run the message loop. | 137 // Run the message loop. |
| 138 message_loop_.RunUntilIdle(); | 138 message_loop_.RunUntilIdle(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 TEST_F(ShillServiceClientTest, SetProperties) { | 141 TEST_F(ShillServiceClientTest, SetProperties) { |
| 142 // Create response. | 142 // Create response. |
| 143 scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty()); | 143 scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty()); |
| 144 | 144 |
| 145 // Set expectations. | 145 // Set expectations. |
| 146 scoped_ptr<base::DictionaryValue> arg(CreateExampleServiceProperties()); | 146 scoped_ptr<base::DictionaryValue> arg(CreateExampleServiceProperties()); |
| 147 PrepareForMethodCall(shill::kSetPropertiesFunction, | 147 PrepareForMethodCall( |
| 148 base::Bind(&ExpectDictionaryValueArgument, arg.get()), | 148 shill::kSetPropertiesFunction, |
| 149 response.get()); | 149 base::Bind(&ExpectDictionaryValueArgument, arg.get(), false), |
|
stevenjb
2014/10/31 16:35:41
comment false
kaliamoorthi
2014/11/03 10:55:38
Done.
| |
| 150 response.get()); | |
| 150 | 151 |
| 151 // Call method. | 152 // Call method. |
| 152 MockClosure mock_closure; | 153 MockClosure mock_closure; |
| 153 MockErrorCallback mock_error_callback; | 154 MockErrorCallback mock_error_callback; |
| 154 client_->SetProperties(dbus::ObjectPath(kExampleServicePath), | 155 client_->SetProperties(dbus::ObjectPath(kExampleServicePath), |
| 155 *arg, | 156 *arg, |
| 156 mock_closure.GetCallback(), | 157 mock_closure.GetCallback(), |
| 157 mock_error_callback.GetCallback()); | 158 mock_error_callback.GetCallback()); |
| 158 EXPECT_CALL(mock_closure, Run()).Times(1); | 159 EXPECT_CALL(mock_closure, Run()).Times(1); |
| 159 EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); | 160 EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 295 mock_closure.GetCallback(), | 296 mock_closure.GetCallback(), |
| 296 mock_error_callback.GetCallback()); | 297 mock_error_callback.GetCallback()); |
| 297 EXPECT_CALL(mock_closure, Run()).Times(1); | 298 EXPECT_CALL(mock_closure, Run()).Times(1); |
| 298 EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); | 299 EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); |
| 299 | 300 |
| 300 // Run the message loop. | 301 // Run the message loop. |
| 301 message_loop_.RunUntilIdle(); | 302 message_loop_.RunUntilIdle(); |
| 302 } | 303 } |
| 303 | 304 |
| 304 } // namespace chromeos | 305 } // namespace chromeos |
| OLD | NEW |