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_manager_client.h" | 8 #include "chromeos/dbus/shill_manager_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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 267 | 267 |
| 268 TEST_F(ShillManagerClientTest, ConfigureService) { | 268 TEST_F(ShillManagerClientTest, ConfigureService) { |
| 269 // Create response. | 269 // Create response. |
| 270 const dbus::ObjectPath object_path("/"); | 270 const dbus::ObjectPath object_path("/"); |
| 271 scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty()); | 271 scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty()); |
| 272 dbus::MessageWriter writer(response.get()); | 272 dbus::MessageWriter writer(response.get()); |
| 273 writer.AppendObjectPath(object_path); | 273 writer.AppendObjectPath(object_path); |
| 274 // Create the argument dictionary. | 274 // Create the argument dictionary. |
| 275 scoped_ptr<base::DictionaryValue> arg(CreateExampleServiceProperties()); | 275 scoped_ptr<base::DictionaryValue> arg(CreateExampleServiceProperties()); |
| 276 // Set expectations. | 276 // Set expectations. |
| 277 PrepareForMethodCall(shill::kConfigureServiceFunction, | 277 PrepareForMethodCall( |
| 278 base::Bind(&ExpectDictionaryValueArgument, arg.get()), | 278 shill::kConfigureServiceFunction, |
| 279 response.get()); | 279 base::Bind(&ExpectDictionaryValueArgument, arg.get(), false), |
|
stevenjb
2014/10/31 16:35:41
comment 'false' here and elsewhere
kaliamoorthi
2014/11/03 10:55:38
Done.
| |
| 280 response.get()); | |
| 280 // Call method. | 281 // Call method. |
| 281 MockErrorCallback mock_error_callback; | 282 MockErrorCallback mock_error_callback; |
| 282 client_->ConfigureService(*arg, | 283 client_->ConfigureService(*arg, |
| 283 base::Bind(&ExpectObjectPathResultWithoutStatus, | 284 base::Bind(&ExpectObjectPathResultWithoutStatus, |
| 284 object_path), | 285 object_path), |
| 285 mock_error_callback.GetCallback()); | 286 mock_error_callback.GetCallback()); |
| 286 EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); | 287 EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); |
| 287 | 288 |
| 288 // Run the message loop. | 289 // Run the message loop. |
| 289 message_loop_.RunUntilIdle(); | 290 message_loop_.RunUntilIdle(); |
| 290 } | 291 } |
| 291 | 292 |
| 292 TEST_F(ShillManagerClientTest, GetService) { | 293 TEST_F(ShillManagerClientTest, GetService) { |
| 293 // Create response. | 294 // Create response. |
| 294 const dbus::ObjectPath object_path("/"); | 295 const dbus::ObjectPath object_path("/"); |
| 295 scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty()); | 296 scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty()); |
| 296 dbus::MessageWriter writer(response.get()); | 297 dbus::MessageWriter writer(response.get()); |
| 297 writer.AppendObjectPath(object_path); | 298 writer.AppendObjectPath(object_path); |
| 298 // Create the argument dictionary. | 299 // Create the argument dictionary. |
| 299 scoped_ptr<base::DictionaryValue> arg(CreateExampleServiceProperties()); | 300 scoped_ptr<base::DictionaryValue> arg(CreateExampleServiceProperties()); |
| 300 // Set expectations. | 301 // Set expectations. |
| 301 PrepareForMethodCall(shill::kGetServiceFunction, | 302 PrepareForMethodCall( |
| 302 base::Bind(&ExpectDictionaryValueArgument, arg.get()), | 303 shill::kGetServiceFunction, |
| 303 response.get()); | 304 base::Bind(&ExpectDictionaryValueArgument, arg.get(), false), |
| 305 response.get()); | |
| 304 // Call method. | 306 // Call method. |
| 305 MockErrorCallback mock_error_callback; | 307 MockErrorCallback mock_error_callback; |
| 306 client_->GetService(*arg, | 308 client_->GetService(*arg, |
| 307 base::Bind(&ExpectObjectPathResultWithoutStatus, | 309 base::Bind(&ExpectObjectPathResultWithoutStatus, |
| 308 object_path), | 310 object_path), |
| 309 mock_error_callback.GetCallback()); | 311 mock_error_callback.GetCallback()); |
| 310 EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); | 312 EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); |
| 311 | 313 |
| 312 // Run the message loop. | 314 // Run the message loop. |
| 313 message_loop_.RunUntilIdle(); | 315 message_loop_.RunUntilIdle(); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 431 arguments[7], | 433 arguments[7], |
| 432 base::Bind(&ExpectStringResultWithoutStatus, expected), | 434 base::Bind(&ExpectStringResultWithoutStatus, expected), |
| 433 mock_error_callback.GetCallback()); | 435 mock_error_callback.GetCallback()); |
| 434 EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); | 436 EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); |
| 435 | 437 |
| 436 // Run the message loop. | 438 // Run the message loop. |
| 437 message_loop_.RunUntilIdle(); | 439 message_loop_.RunUntilIdle(); |
| 438 } | 440 } |
| 439 | 441 |
| 440 } // namespace chromeos | 442 } // namespace chromeos |
| OLD | NEW |