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_connection_handler.h" | 5 #include "chromeos/network/network_connection_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "chromeos/dbus/dbus_thread_manager.h" | 10 #include "chromeos/dbus/dbus_thread_manager.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 const char* kConfigRequiresActivation = | 153 const char* kConfigRequiresActivation = |
154 "{ \"GUID\": \"cellular1\", \"Type\": \"cellular\"," | 154 "{ \"GUID\": \"cellular1\", \"Type\": \"cellular\"," |
155 " \"Cellular.ActivationState\": \"not-activated\" }"; | 155 " \"Cellular.ActivationState\": \"not-activated\" }"; |
156 | 156 |
157 } // namespace | 157 } // namespace |
158 | 158 |
159 TEST_F(NetworkConnectionHandlerTest, NetworkConnectionHandlerConnectSuccess) { | 159 TEST_F(NetworkConnectionHandlerTest, NetworkConnectionHandlerConnectSuccess) { |
160 EXPECT_TRUE(Configure(kConfigConnectable)); | 160 EXPECT_TRUE(Configure(kConfigConnectable)); |
161 Connect("wifi0"); | 161 Connect("wifi0"); |
162 EXPECT_EQ(kSuccessResult, GetResultAndReset()); | 162 EXPECT_EQ(kSuccessResult, GetResultAndReset()); |
163 EXPECT_EQ(flimflam::kStateOnline, | 163 EXPECT_EQ(shill::kStateOnline, |
164 GetServiceStringProperty("wifi0", flimflam::kStateProperty)); | 164 GetServiceStringProperty("wifi0", shill::kStateProperty)); |
165 } | 165 } |
166 | 166 |
167 // Handles basic failure cases. | 167 // Handles basic failure cases. |
168 TEST_F(NetworkConnectionHandlerTest, NetworkConnectionHandlerConnectFailure) { | 168 TEST_F(NetworkConnectionHandlerTest, NetworkConnectionHandlerConnectFailure) { |
169 Connect("no-network"); | 169 Connect("no-network"); |
170 EXPECT_EQ(NetworkConnectionHandler::kErrorConfigureFailed, | 170 EXPECT_EQ(NetworkConnectionHandler::kErrorConfigureFailed, |
171 GetResultAndReset()); | 171 GetResultAndReset()); |
172 | 172 |
173 EXPECT_TRUE(Configure(kConfigConnected)); | 173 EXPECT_TRUE(Configure(kConfigConnected)); |
174 Connect("wifi1"); | 174 Connect("wifi1"); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 Connect("no-network"); | 224 Connect("no-network"); |
225 EXPECT_EQ(NetworkConnectionHandler::kErrorConfigureFailed, | 225 EXPECT_EQ(NetworkConnectionHandler::kErrorConfigureFailed, |
226 GetResultAndReset()); | 226 GetResultAndReset()); |
227 | 227 |
228 EXPECT_TRUE(Configure(kConfigConnectable)); | 228 EXPECT_TRUE(Configure(kConfigConnectable)); |
229 Disconnect("wifi0"); | 229 Disconnect("wifi0"); |
230 EXPECT_EQ(NetworkConnectionHandler::kErrorNotConnected, GetResultAndReset()); | 230 EXPECT_EQ(NetworkConnectionHandler::kErrorNotConnected, GetResultAndReset()); |
231 } | 231 } |
232 | 232 |
233 } // namespace chromeos | 233 } // namespace chromeos |
OLD | NEW |