| 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 <stdint.h> |
| 6 |
| 5 #include "base/bind.h" | 7 #include "base/bind.h" |
| 6 #include "base/values.h" | 8 #include "base/values.h" |
| 7 #include "chromeos/dbus/shill_client_unittest_base.h" | 9 #include "chromeos/dbus/shill_client_unittest_base.h" |
| 8 #include "chromeos/dbus/shill_ipconfig_client.h" | 10 #include "chromeos/dbus/shill_ipconfig_client.h" |
| 9 #include "dbus/message.h" | 11 #include "dbus/message.h" |
| 10 #include "dbus/values_util.h" | 12 #include "dbus/values_util.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 12 #include "third_party/cros_system_api/dbus/service_constants.h" | 14 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 13 | 15 |
| 14 using testing::_; | 16 using testing::_; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 &observer); | 75 &observer); |
| 74 | 76 |
| 75 EXPECT_CALL(observer, OnPropertyChanged(_, _)).Times(0); | 77 EXPECT_CALL(observer, OnPropertyChanged(_, _)).Times(0); |
| 76 | 78 |
| 77 // Run the signal callback again and make sure the observer isn't called. | 79 // Run the signal callback again and make sure the observer isn't called. |
| 78 SendPropertyChangedSignal(&signal); | 80 SendPropertyChangedSignal(&signal); |
| 79 } | 81 } |
| 80 | 82 |
| 81 TEST_F(ShillIPConfigClientTest, GetProperties) { | 83 TEST_F(ShillIPConfigClientTest, GetProperties) { |
| 82 const char kAddress[] = "address"; | 84 const char kAddress[] = "address"; |
| 83 const int32 kMtu = 68; | 85 const int32_t kMtu = 68; |
| 84 | 86 |
| 85 // Create response. | 87 // Create response. |
| 86 scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty()); | 88 scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty()); |
| 87 dbus::MessageWriter writer(response.get()); | 89 dbus::MessageWriter writer(response.get()); |
| 88 dbus::MessageWriter array_writer(NULL); | 90 dbus::MessageWriter array_writer(NULL); |
| 89 writer.OpenArray("{sv}", &array_writer); | 91 writer.OpenArray("{sv}", &array_writer); |
| 90 dbus::MessageWriter entry_writer(NULL); | 92 dbus::MessageWriter entry_writer(NULL); |
| 91 // Append address. | 93 // Append address. |
| 92 array_writer.OpenDictEntry(&entry_writer); | 94 array_writer.OpenDictEntry(&entry_writer); |
| 93 entry_writer.AppendString(shill::kAddressProperty); | 95 entry_writer.AppendString(shill::kAddressProperty); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 response.get()); | 169 response.get()); |
| 168 // Call method. | 170 // Call method. |
| 169 client_->Remove(dbus::ObjectPath(kExampleIPConfigPath), | 171 client_->Remove(dbus::ObjectPath(kExampleIPConfigPath), |
| 170 base::Bind(&ExpectNoResultValue)); | 172 base::Bind(&ExpectNoResultValue)); |
| 171 | 173 |
| 172 // Run the message loop. | 174 // Run the message loop. |
| 173 message_loop_.RunUntilIdle(); | 175 message_loop_.RunUntilIdle(); |
| 174 } | 176 } |
| 175 | 177 |
| 176 } // namespace chromeos | 178 } // namespace chromeos |
| OLD | NEW |