Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: chromeos/components/tether/active_host_network_state_updater_unittest.cc

Issue 2850993002: [CrOS Tether] Add the HasConnectedToHost network field to NetworkStateHandler. (Closed)
Patch Set: stevenjb@ comments. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 fake_active_host_ = base::MakeUnique<FakeActiveHost>(); 55 fake_active_host_ = base::MakeUnique<FakeActiveHost>();
56 56
57 updater_ = base::WrapUnique(new ActiveHostNetworkStateUpdater( 57 updater_ = base::WrapUnique(new ActiveHostNetworkStateUpdater(
58 fake_active_host_.get(), network_state_handler())); 58 fake_active_host_.get(), network_state_handler()));
59 } 59 }
60 60
61 void SetUpTetherNetwork() { 61 void SetUpTetherNetwork() {
62 // Add tether network whose status will be changed during the test. 62 // Add tether network whose status will be changed during the test.
63 network_state_handler()->AddTetherNetworkState( 63 network_state_handler()->AddTetherNetworkState(
64 kTetherNetworkGuid, "TetherNetworkName", "TetherNetworkCarrier", 64 kTetherNetworkGuid, "TetherNetworkName", "TetherNetworkCarrier",
65 100 /* battery_percentage */, 100 /* signal_strength */); 65 100 /* battery_percentage */, 100 /* signal_strength */,
66 true /* has_connected_to_host */);
66 } 67 }
67 68
68 void SetUpWifiNetwork() { 69 void SetUpWifiNetwork() {
69 ConfigureService(CreateWifiConfigurationJsonString(kWifiNetworkGuid)); 70 ConfigureService(CreateWifiConfigurationJsonString(kWifiNetworkGuid));
70 network_state_handler()->AssociateTetherNetworkStateWithWifiNetwork( 71 network_state_handler()->AssociateTetherNetworkStateWithWifiNetwork(
71 kTetherNetworkGuid, kWifiNetworkGuid); 72 kTetherNetworkGuid, kWifiNetworkGuid);
72 } 73 }
73 74
74 void TearDown() override { 75 void TearDown() override {
75 ShutdownNetworkState(); 76 ShutdownNetworkState();
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 kWifiNetworkGuid); 120 kWifiNetworkGuid);
120 VerifyConnected(); 121 VerifyConnected();
121 122
122 fake_active_host_->SetActiveHostDisconnected(); 123 fake_active_host_->SetActiveHostDisconnected();
123 VerifyDisconnected(); 124 VerifyDisconnected();
124 } 125 }
125 126
126 } // namespace tether 127 } // namespace tether
127 128
128 } // namespace chromeos 129 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/networking_private/chromeos/test.js ('k') | chromeos/components/tether/host_scanner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698