| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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.SetWithoutPathExpansion(shill::kSignalStrengthProperty, |
| 103 base::Value::CreateIntegerValue(kValue)); | 103 new base::FundamentalValue(kValue)); |
| 104 PrepareForMethodCall(shill::kGetPropertiesFunction, | 104 PrepareForMethodCall(shill::kGetPropertiesFunction, |
| 105 base::Bind(&ExpectNoArgument), | 105 base::Bind(&ExpectNoArgument), |
| 106 response.get()); | 106 response.get()); |
| 107 // Call method. | 107 // Call method. |
| 108 client_->GetProperties(dbus::ObjectPath(kExampleServicePath), | 108 client_->GetProperties(dbus::ObjectPath(kExampleServicePath), |
| 109 base::Bind(&ExpectDictionaryValueResult, &value)); | 109 base::Bind(&ExpectDictionaryValueResult, &value)); |
| 110 // Run the message loop. | 110 // Run the message loop. |
| 111 message_loop_.RunUntilIdle(); | 111 message_loop_.RunUntilIdle(); |
| 112 } | 112 } |
| 113 | 113 |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 mock_closure.GetCallback(), | 295 mock_closure.GetCallback(), |
| 296 mock_error_callback.GetCallback()); | 296 mock_error_callback.GetCallback()); |
| 297 EXPECT_CALL(mock_closure, Run()).Times(1); | 297 EXPECT_CALL(mock_closure, Run()).Times(1); |
| 298 EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); | 298 EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); |
| 299 | 299 |
| 300 // Run the message loop. | 300 // Run the message loop. |
| 301 message_loop_.RunUntilIdle(); | 301 message_loop_.RunUntilIdle(); |
| 302 } | 302 } |
| 303 | 303 |
| 304 } // namespace chromeos | 304 } // namespace chromeos |
| OLD | NEW |