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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 DBusThreadManager::Get()->GetShillServiceClient()->GetTestInterface() | 45 DBusThreadManager::Get()->GetShillServiceClient()->GetTestInterface() |
46 ->ClearServices(); | 46 ->ClearServices(); |
47 message_loop_.RunUntilIdle(); | 47 message_loop_.RunUntilIdle(); |
48 LoginState::Initialize(); | 48 LoginState::Initialize(); |
49 network_state_handler_.reset(NetworkStateHandler::InitializeForTest()); | 49 network_state_handler_.reset(NetworkStateHandler::InitializeForTest()); |
50 network_configuration_handler_.reset( | 50 network_configuration_handler_.reset( |
51 NetworkConfigurationHandler::InitializeForTest( | 51 NetworkConfigurationHandler::InitializeForTest( |
52 network_state_handler_.get())); | 52 network_state_handler_.get())); |
53 network_connection_handler_.reset(new NetworkConnectionHandler); | 53 network_connection_handler_.reset(new NetworkConnectionHandler); |
54 // TODO(stevenjb): Test integration with CertLoader using a stub or mock. | 54 // TODO(stevenjb): Test integration with CertLoader using a stub or mock. |
55 network_connection_handler_->Init(NULL /* cert_loader */, | 55 network_connection_handler_->Init(network_state_handler_.get(), |
56 network_state_handler_.get(), | |
57 network_configuration_handler_.get()); | 56 network_configuration_handler_.get()); |
58 } | 57 } |
59 | 58 |
60 virtual void TearDown() OVERRIDE { | 59 virtual void TearDown() OVERRIDE { |
61 network_connection_handler_.reset(); | 60 network_connection_handler_.reset(); |
62 network_configuration_handler_.reset(); | 61 network_configuration_handler_.reset(); |
63 network_state_handler_.reset(); | 62 network_state_handler_.reset(); |
64 LoginState::Shutdown(); | 63 LoginState::Shutdown(); |
65 DBusThreadManager::Shutdown(); | 64 DBusThreadManager::Shutdown(); |
66 } | 65 } |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 NetworkConnectionHandlerDisconnectFailure) { | 221 NetworkConnectionHandlerDisconnectFailure) { |
223 Connect("no-network"); | 222 Connect("no-network"); |
224 EXPECT_EQ(NetworkConnectionHandler::kErrorNotFound, GetResultAndReset()); | 223 EXPECT_EQ(NetworkConnectionHandler::kErrorNotFound, GetResultAndReset()); |
225 | 224 |
226 EXPECT_TRUE(Configure(kConfigConnectable)); | 225 EXPECT_TRUE(Configure(kConfigConnectable)); |
227 Disconnect("wifi0"); | 226 Disconnect("wifi0"); |
228 EXPECT_EQ(NetworkConnectionHandler::kErrorNotConnected, GetResultAndReset()); | 227 EXPECT_EQ(NetworkConnectionHandler::kErrorNotConnected, GetResultAndReset()); |
229 } | 228 } |
230 | 229 |
231 } // namespace chromeos | 230 } // namespace chromeos |
OLD | NEW |