| 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 "chromeos/dbus/modem_messaging_client.h" | 5 #include "chromeos/dbus/modem_messaging_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "dbus/message.h" | 10 #include "dbus/message.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 class MockListCallback { | 40 class MockListCallback { |
| 41 public: | 41 public: |
| 42 MOCK_METHOD1(Run, void(const std::vector<dbus::ObjectPath>& result)); | 42 MOCK_METHOD1(Run, void(const std::vector<dbus::ObjectPath>& result)); |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 // D-Bus service name used by test. | 45 // D-Bus service name used by test. |
| 46 const char kServiceName[] = "service.name"; | 46 const char kServiceName[] = "service.name"; |
| 47 // D-Bus object path used by test. | 47 // D-Bus object path used by test. |
| 48 const char kObjectPath[] = "/object/path"; | 48 const char kObjectPath[] = "/object/path"; |
| 49 | 49 |
| 50 // Keys of SMS dictionary. | |
| 51 const char kNumberKey[] = "number"; | |
| 52 const char kTextKey[] = "text"; | |
| 53 | |
| 54 // Example values of SMS dictionary. | |
| 55 const char kExampleNumber[] = "00012345678"; | |
| 56 const char kExampleText[] = "Hello."; | |
| 57 | |
| 58 } // namespace | 50 } // namespace |
| 59 | 51 |
| 60 class ModemMessagingClientTest : public testing::Test { | 52 class ModemMessagingClientTest : public testing::Test { |
| 61 public: | 53 public: |
| 62 ModemMessagingClientTest() : response_(NULL), | 54 ModemMessagingClientTest() : response_(NULL), |
| 63 expected_result_(NULL) {} | 55 expected_result_(NULL) {} |
| 64 | 56 |
| 65 virtual void SetUp() OVERRIDE { | 57 virtual void SetUp() OVERRIDE { |
| 66 // Create a mock bus. | 58 // Create a mock bus. |
| 67 dbus::Bus::Options options; | 59 dbus::Bus::Options options; |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 // Call List. | 234 // Call List. |
| 243 client_->List(kServiceName, dbus::ObjectPath(kObjectPath), | 235 client_->List(kServiceName, dbus::ObjectPath(kObjectPath), |
| 244 base::Bind(&MockListCallback::Run, | 236 base::Bind(&MockListCallback::Run, |
| 245 base::Unretained(&callback))); | 237 base::Unretained(&callback))); |
| 246 | 238 |
| 247 // Run the message loop. | 239 // Run the message loop. |
| 248 message_loop_.RunUntilIdle(); | 240 message_loop_.RunUntilIdle(); |
| 249 } | 241 } |
| 250 | 242 |
| 251 } // namespace chromeos | 243 } // namespace chromeos |
| OLD | NEW |