| 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/run_loop.h" | 6 #include "base/run_loop.h" |
| 7 #include "base/test/mock_callback.h" | 7 #include "base/test/mock_callback.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chromeos/dbus/shill_client_unittest_base.h" | 9 #include "chromeos/dbus/shill_client_unittest_base.h" |
| 10 #include "chromeos/dbus/shill_device_client.h" | 10 #include "chromeos/dbus/shill_device_client.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 writer.OpenArray("{sv}", &array_writer); | 119 writer.OpenArray("{sv}", &array_writer); |
| 120 dbus::MessageWriter entry_writer(NULL); | 120 dbus::MessageWriter entry_writer(NULL); |
| 121 array_writer.OpenDictEntry(&entry_writer); | 121 array_writer.OpenDictEntry(&entry_writer); |
| 122 entry_writer.AppendString(shill::kCellularAllowRoamingProperty); | 122 entry_writer.AppendString(shill::kCellularAllowRoamingProperty); |
| 123 entry_writer.AppendVariantOfBool(kValue); | 123 entry_writer.AppendVariantOfBool(kValue); |
| 124 array_writer.CloseContainer(&entry_writer); | 124 array_writer.CloseContainer(&entry_writer); |
| 125 writer.CloseContainer(&array_writer); | 125 writer.CloseContainer(&array_writer); |
| 126 | 126 |
| 127 // Set expectations. | 127 // Set expectations. |
| 128 base::DictionaryValue value; | 128 base::DictionaryValue value; |
| 129 value.SetWithoutPathExpansion(shill::kCellularAllowRoamingProperty, | 129 value.SetBooleanWithoutPathExpansion(shill::kCellularAllowRoamingProperty, |
| 130 new base::Value(kValue)); | 130 kValue); |
| 131 PrepareForMethodCall(shill::kGetPropertiesFunction, | 131 PrepareForMethodCall(shill::kGetPropertiesFunction, |
| 132 base::Bind(&ExpectNoArgument), | 132 base::Bind(&ExpectNoArgument), |
| 133 response.get()); | 133 response.get()); |
| 134 // Call method. | 134 // Call method. |
| 135 client_->GetProperties(dbus::ObjectPath(kExampleDevicePath), | 135 client_->GetProperties(dbus::ObjectPath(kExampleDevicePath), |
| 136 base::Bind(&ExpectDictionaryValueResult, &value)); | 136 base::Bind(&ExpectDictionaryValueResult, &value)); |
| 137 // Run the message loop. | 137 // Run the message loop. |
| 138 base::RunLoop().RunUntilIdle(); | 138 base::RunLoop().RunUntilIdle(); |
| 139 } | 139 } |
| 140 | 140 |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 response.get()); | 357 response.get()); |
| 358 EXPECT_CALL(mock_closure, Run()).Times(1); | 358 EXPECT_CALL(mock_closure, Run()).Times(1); |
| 359 // Call method. | 359 // Call method. |
| 360 client_->Reset(dbus::ObjectPath(kExampleDevicePath), mock_closure.Get(), | 360 client_->Reset(dbus::ObjectPath(kExampleDevicePath), mock_closure.Get(), |
| 361 mock_error_callback.Get()); | 361 mock_error_callback.Get()); |
| 362 // Run the message loop. | 362 // Run the message loop. |
| 363 base::RunLoop().RunUntilIdle(); | 363 base::RunLoop().RunUntilIdle(); |
| 364 } | 364 } |
| 365 | 365 |
| 366 } // namespace chromeos | 366 } // namespace chromeos |
| OLD | NEW |