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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 }; | 96 }; |
97 | 97 |
98 TEST_F(NetworkSmsHandlerTest, SmsHandlerDbusStub) { | 98 TEST_F(NetworkSmsHandlerTest, SmsHandlerDbusStub) { |
99 EXPECT_EQ(test_observer_->message_count(), 0); | 99 EXPECT_EQ(test_observer_->message_count(), 0); |
100 | 100 |
101 // Test that no messages have been received yet | 101 // Test that no messages have been received yet |
102 const std::set<std::string>& messages(test_observer_->messages()); | 102 const std::set<std::string>& messages(test_observer_->messages()); |
103 // Note: The following string corresponds to values in | 103 // Note: The following string corresponds to values in |
104 // ModemMessagingClientStubImpl and SmsClientStubImpl. | 104 // ModemMessagingClientStubImpl and SmsClientStubImpl. |
105 // TODO(stevenjb): Use a TestInterface to set this up to remove dependency. | 105 // TODO(stevenjb): Use a TestInterface to set this up to remove dependency. |
106 const char kMessage1[] = "SMSClientStubImpl: Test Message: /SMS/0"; | 106 const char kMessage1[] = "FakeSMSClient: Test Message: /SMS/0"; |
107 EXPECT_EQ(messages.find(kMessage1), messages.end()); | 107 EXPECT_EQ(messages.find(kMessage1), messages.end()); |
108 | 108 |
109 // Test for messages delivered by signals. | 109 // Test for messages delivered by signals. |
110 test_observer_->ClearMessages(); | 110 test_observer_->ClearMessages(); |
111 network_sms_handler_->RequestUpdate(false); | 111 network_sms_handler_->RequestUpdate(false); |
112 message_loop_.RunUntilIdle(); | 112 message_loop_.RunUntilIdle(); |
113 EXPECT_GE(test_observer_->message_count(), 1); | 113 EXPECT_GE(test_observer_->message_count(), 1); |
114 EXPECT_NE(messages.find(kMessage1), messages.end()); | 114 EXPECT_NE(messages.find(kMessage1), messages.end()); |
115 } | 115 } |
116 | 116 |
117 } // namespace chromeos | 117 } // namespace chromeos |
OLD | NEW |