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