| 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_service_client.h" | 10 #include "chromeos/dbus/shill_service_client.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 writer.OpenArray("{sv}", &array_writer); | 92 writer.OpenArray("{sv}", &array_writer); |
| 93 dbus::MessageWriter entry_writer(NULL); | 93 dbus::MessageWriter entry_writer(NULL); |
| 94 array_writer.OpenDictEntry(&entry_writer); | 94 array_writer.OpenDictEntry(&entry_writer); |
| 95 entry_writer.AppendString(shill::kSignalStrengthProperty); | 95 entry_writer.AppendString(shill::kSignalStrengthProperty); |
| 96 entry_writer.AppendVariantOfByte(kValue); | 96 entry_writer.AppendVariantOfByte(kValue); |
| 97 array_writer.CloseContainer(&entry_writer); | 97 array_writer.CloseContainer(&entry_writer); |
| 98 writer.CloseContainer(&array_writer); | 98 writer.CloseContainer(&array_writer); |
| 99 | 99 |
| 100 // Set expectations. | 100 // Set expectations. |
| 101 base::DictionaryValue value; | 101 base::DictionaryValue value; |
| 102 value.SetWithoutPathExpansion(shill::kSignalStrengthProperty, | 102 value.SetIntegerWithoutPathExpansion(shill::kSignalStrengthProperty, kValue); |
| 103 new base::Value(kValue)); | |
| 104 PrepareForMethodCall(shill::kGetPropertiesFunction, | 103 PrepareForMethodCall(shill::kGetPropertiesFunction, |
| 105 base::Bind(&ExpectNoArgument), | 104 base::Bind(&ExpectNoArgument), |
| 106 response.get()); | 105 response.get()); |
| 107 // Call method. | 106 // Call method. |
| 108 client_->GetProperties(dbus::ObjectPath(kExampleServicePath), | 107 client_->GetProperties(dbus::ObjectPath(kExampleServicePath), |
| 109 base::Bind(&ExpectDictionaryValueResult, &value)); | 108 base::Bind(&ExpectDictionaryValueResult, &value)); |
| 110 // Run the message loop. | 109 // Run the message loop. |
| 111 base::RunLoop().RunUntilIdle(); | 110 base::RunLoop().RunUntilIdle(); |
| 112 } | 111 } |
| 113 | 112 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 kCarrier, mock_closure.Get(), | 288 kCarrier, mock_closure.Get(), |
| 290 mock_error_callback.Get()); | 289 mock_error_callback.Get()); |
| 291 EXPECT_CALL(mock_closure, Run()).Times(1); | 290 EXPECT_CALL(mock_closure, Run()).Times(1); |
| 292 EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); | 291 EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); |
| 293 | 292 |
| 294 // Run the message loop. | 293 // Run the message loop. |
| 295 base::RunLoop().RunUntilIdle(); | 294 base::RunLoop().RunUntilIdle(); |
| 296 } | 295 } |
| 297 | 296 |
| 298 } // namespace chromeos | 297 } // namespace chromeos |
| OLD | NEW |