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

Side by Side Diff: chromeos/network/network_connect_unittest.cc

Issue 2819383002: [CrOS Tether] Update NetworkState to include tether properties and integrate into NetworkStateHandl… (Closed)
Patch Set: Fix comments, add style change, change a LOG to a DCHECK. Created 3 years, 8 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_connect.h" 5 #include "chromeos/network/network_connect.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 base::RunLoop().RunUntilIdle(); 330 base::RunLoop().RunUntilIdle();
331 331
332 NetworkConnect::Get()->SetTechnologyEnabled(NetworkTypePattern::Cellular(), 332 NetworkConnect::Get()->SetTechnologyEnabled(NetworkTypePattern::Cellular(),
333 true); 333 true);
334 } 334 }
335 335
336 TEST_F(NetworkConnectTest, ConnectToTetherNetwork) { 336 TEST_F(NetworkConnectTest, ConnectToTetherNetwork) {
337 EXPECT_CALL(*mock_tether_delegate_, ConnectToNetwork(kTether1Guid)); 337 EXPECT_CALL(*mock_tether_delegate_, ConnectToNetwork(kTether1Guid));
338 338
339 NetworkHandler::Get()->network_state_handler()->AddTetherNetworkState( 339 NetworkHandler::Get()->network_state_handler()->AddTetherNetworkState(
340 kTether1Guid, "TetherNetwork"); 340 kTether1Guid, "TetherNetwork", "Carrier", 100 /* battery_percentage */,
341 100 /* signal_strength */);
341 342
342 NetworkConnect::Get()->SetTetherDelegate(mock_tether_delegate_.get()); 343 NetworkConnect::Get()->SetTetherDelegate(mock_tether_delegate_.get());
343 NetworkConnect::Get()->ConnectToNetworkId(kTether1Guid); 344 NetworkConnect::Get()->ConnectToNetworkId(kTether1Guid);
344 } 345 }
345 346
346 TEST_F(NetworkConnectTest, ConnectToTetherNetwork_TetherNetworkDoesNotExist) { 347 TEST_F(NetworkConnectTest, ConnectToTetherNetwork_TetherNetworkDoesNotExist) {
347 EXPECT_CALL(*mock_tether_delegate_, ConnectToNetwork(_)).Times(0); 348 EXPECT_CALL(*mock_tether_delegate_, ConnectToNetwork(_)).Times(0);
348 349
349 NetworkConnect::Get()->SetTetherDelegate(mock_tether_delegate_.get()); 350 NetworkConnect::Get()->SetTetherDelegate(mock_tether_delegate_.get());
350 NetworkConnect::Get()->ConnectToNetworkId(kTether1Guid); 351 NetworkConnect::Get()->ConnectToNetworkId(kTether1Guid);
351 } 352 }
352 353
353 TEST_F(NetworkConnectTest, ConnectToTetherNetwork_TetherDelegateNotSet) { 354 TEST_F(NetworkConnectTest, ConnectToTetherNetwork_TetherDelegateNotSet) {
354 EXPECT_CALL(*mock_tether_delegate_, ConnectToNetwork(_)).Times(0); 355 EXPECT_CALL(*mock_tether_delegate_, ConnectToNetwork(_)).Times(0);
355 356
356 NetworkHandler::Get()->network_state_handler()->AddTetherNetworkState( 357 NetworkHandler::Get()->network_state_handler()->AddTetherNetworkState(
357 kTether1Guid, "TetherNetwork"); 358 kTether1Guid, "TetherNetwork", "Carrier", 100 /* battery_percentage */,
359 100 /* signal_strength */);
358 360
359 NetworkConnect::Get()->ConnectToNetworkId(kTether1Guid); 361 NetworkConnect::Get()->ConnectToNetworkId(kTether1Guid);
360 } 362 }
361 363
362 } // namespace chromeos 364 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698