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/network/network_sms_handler.h" | 5 #include "chromeos/network/network_sms_handler.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 NetworkSmsHandlerTest() {} | 53 NetworkSmsHandlerTest() {} |
54 virtual ~NetworkSmsHandlerTest() {} | 54 virtual ~NetworkSmsHandlerTest() {} |
55 | 55 |
56 virtual void SetUp() OVERRIDE { | 56 virtual void SetUp() OVERRIDE { |
57 // Append '--sms-test-messages' to the command line to tell | 57 // Append '--sms-test-messages' to the command line to tell |
58 // SMSClientStubImpl to generate a series of test SMS messages. | 58 // SMSClientStubImpl to generate a series of test SMS messages. |
59 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 59 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
60 command_line->AppendSwitch(chromeos::switches::kSmsTestMessages); | 60 command_line->AppendSwitch(chromeos::switches::kSmsTestMessages); |
61 | 61 |
62 // Initialize DBusThreadManager with a stub implementation. | 62 // Initialize DBusThreadManager with a stub implementation. |
63 DBusThreadManager::InitializeWithStub(); | 63 DBusThreadManager::Initialize(); |
64 ShillDeviceClient::TestInterface* device_test = | 64 ShillDeviceClient::TestInterface* device_test = |
65 DBusThreadManager::Get()->GetShillDeviceClient()->GetTestInterface(); | 65 DBusThreadManager::Get()->GetShillDeviceClient()->GetTestInterface(); |
66 ASSERT_TRUE(device_test); | 66 ASSERT_TRUE(device_test); |
67 device_test->AddDevice("/org/freedesktop/ModemManager1/stub/0", | 67 device_test->AddDevice("/org/freedesktop/ModemManager1/stub/0", |
68 shill::kTypeCellular, | 68 shill::kTypeCellular, |
69 "stub_cellular_device2"); | 69 "stub_cellular_device2"); |
70 | 70 |
71 // This relies on the stub dbus implementations for ShillManagerClient, | 71 // This relies on the stub dbus implementations for ShillManagerClient, |
72 // ShillDeviceClient, GsmSMSClient, ModemMessagingClient and SMSClient. | 72 // ShillDeviceClient, GsmSMSClient, ModemMessagingClient and SMSClient. |
73 // Initialize a sms handler. The stub dbus clients will not send the | 73 // Initialize a sms handler. The stub dbus clients will not send the |
(...skipping 30 matching lines...) Expand all Loading... |
104 | 104 |
105 // Test for messages delivered by signals. | 105 // Test for messages delivered by signals. |
106 test_observer_->ClearMessages(); | 106 test_observer_->ClearMessages(); |
107 network_sms_handler_->RequestUpdate(false); | 107 network_sms_handler_->RequestUpdate(false); |
108 message_loop_.RunUntilIdle(); | 108 message_loop_.RunUntilIdle(); |
109 EXPECT_GE(test_observer_->message_count(), 1); | 109 EXPECT_GE(test_observer_->message_count(), 1); |
110 EXPECT_NE(messages.find(kMessage1), messages.end()); | 110 EXPECT_NE(messages.find(kMessage1), messages.end()); |
111 } | 111 } |
112 | 112 |
113 } // namespace chromeos | 113 } // namespace chromeos |
OLD | NEW |