| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/components/tether/active_host_network_state_updater.h" | 5 #include "chromeos/components/tether/active_host_network_state_updater.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 } // namespace | 40 } // namespace |
| 41 | 41 |
| 42 class ActiveHostNetworkStateUpdaterTest : public NetworkStateTest { | 42 class ActiveHostNetworkStateUpdaterTest : public NetworkStateTest { |
| 43 protected: | 43 protected: |
| 44 ActiveHostNetworkStateUpdaterTest() : NetworkStateTest() {} | 44 ActiveHostNetworkStateUpdaterTest() : NetworkStateTest() {} |
| 45 ~ActiveHostNetworkStateUpdaterTest() override {} | 45 ~ActiveHostNetworkStateUpdaterTest() override {} |
| 46 | 46 |
| 47 void SetUp() override { | 47 void SetUp() override { |
| 48 DBusThreadManager::Initialize(); | 48 DBusThreadManager::Initialize(); |
| 49 NetworkStateTest::SetUp(); | 49 NetworkStateTest::SetUp(); |
| 50 network_state_handler()->SetTetherTechnologyState( | |
| 51 NetworkStateHandler::TECHNOLOGY_ENABLED); | |
| 52 SetUpTetherNetwork(); | 50 SetUpTetherNetwork(); |
| 53 SetUpWifiNetwork(); | 51 SetUpWifiNetwork(); |
| 54 | 52 |
| 55 fake_active_host_ = base::MakeUnique<FakeActiveHost>(); | 53 fake_active_host_ = base::MakeUnique<FakeActiveHost>(); |
| 56 | 54 |
| 57 updater_ = base::WrapUnique(new ActiveHostNetworkStateUpdater( | 55 updater_ = base::WrapUnique(new ActiveHostNetworkStateUpdater( |
| 58 fake_active_host_.get(), network_state_handler())); | 56 fake_active_host_.get(), network_state_handler())); |
| 59 } | 57 } |
| 60 | 58 |
| 61 void SetUpTetherNetwork() { | 59 void SetUpTetherNetwork() { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 kWifiNetworkGuid); | 117 kWifiNetworkGuid); |
| 120 VerifyConnected(); | 118 VerifyConnected(); |
| 121 | 119 |
| 122 fake_active_host_->SetActiveHostDisconnected(); | 120 fake_active_host_->SetActiveHostDisconnected(); |
| 123 VerifyDisconnected(); | 121 VerifyDisconnected(); |
| 124 } | 122 } |
| 125 | 123 |
| 126 } // namespace tether | 124 } // namespace tether |
| 127 | 125 |
| 128 } // namespace chromeos | 126 } // namespace chromeos |
| OLD | NEW |