| 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/flimflam_client_unittest_base.h" | 7 #include "chromeos/dbus/flimflam_client_unittest_base.h" |
| 8 #include "chromeos/dbus/flimflam_service_client.h" | 8 #include "chromeos/dbus/flimflam_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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 base::Bind(&ExpectStringArgument, kCarrier), | 193 base::Bind(&ExpectStringArgument, kCarrier), |
| 194 response.get()); | 194 response.get()); |
| 195 // Call method. | 195 // Call method. |
| 196 client_->ActivateCellularModem(dbus::ObjectPath(kExampleServicePath), | 196 client_->ActivateCellularModem(dbus::ObjectPath(kExampleServicePath), |
| 197 kCarrier, | 197 kCarrier, |
| 198 base::Bind(&ExpectNoResultValue)); | 198 base::Bind(&ExpectNoResultValue)); |
| 199 // Run the message loop. | 199 // Run the message loop. |
| 200 message_loop_.RunAllPending(); | 200 message_loop_.RunAllPending(); |
| 201 } | 201 } |
| 202 | 202 |
| 203 TEST_F(FlimflamServiceClientTest, CallActivateCellularModemAndBlock) { |
| 204 const char kCarrier[] = "carrier"; |
| 205 // Create response. |
| 206 scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty()); |
| 207 |
| 208 // Set expectations. |
| 209 PrepareForMethodCall(flimflam::kActivateCellularModemFunction, |
| 210 base::Bind(&ExpectStringArgument, kCarrier), |
| 211 response.get()); |
| 212 // Call method. |
| 213 const bool result = client_->CallActivateCellularModemAndBlock( |
| 214 dbus::ObjectPath(kExampleServicePath), kCarrier); |
| 215 EXPECT_TRUE(result); |
| 216 } |
| 217 |
| 203 } // namespace chromeos | 218 } // namespace chromeos |
| OLD | NEW |