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

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

Issue 2478573003: NetworkStateHandler::InitializeForTest() should return a std::unique_ptr. (Closed)
Patch Set: Created 4 years, 1 month 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/prohibited_technologies_handler.h" 5 #include "chromeos/network/prohibited_technologies_handler.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 test_manager_client_->AddTechnology(shill::kTypeWifi, true /* enabled */); 45 test_manager_client_->AddTechnology(shill::kTypeWifi, true /* enabled */);
46 test_manager_client_->AddTechnology(shill::kTypeCellular, 46 test_manager_client_->AddTechnology(shill::kTypeCellular,
47 true /* enabled */); 47 true /* enabled */);
48 dbus_manager->GetShillProfileClient()->GetTestInterface()->AddProfile( 48 dbus_manager->GetShillProfileClient()->GetTestInterface()->AddProfile(
49 "shared_profile_path", std::string() /* shared profile */); 49 "shared_profile_path", std::string() /* shared profile */);
50 dbus_manager->GetShillProfileClient()->GetTestInterface()->AddProfile( 50 dbus_manager->GetShillProfileClient()->GetTestInterface()->AddProfile(
51 "user_profile_path", kUserHash); 51 "user_profile_path", kUserHash);
52 52
53 base::RunLoop().RunUntilIdle(); 53 base::RunLoop().RunUntilIdle();
54 network_state_handler_.reset(NetworkStateHandler::InitializeForTest()); 54 network_state_handler_ = NetworkStateHandler::InitializeForTest();
55 network_config_handler_.reset( 55 network_config_handler_.reset(
56 NetworkConfigurationHandler::InitializeForTest( 56 NetworkConfigurationHandler::InitializeForTest(
57 network_state_handler_.get(), NULL /* network_device_handler */)); 57 network_state_handler_.get(), NULL /* network_device_handler */));
58 58
59 network_profile_handler_.reset(new NetworkProfileHandler()); 59 network_profile_handler_.reset(new NetworkProfileHandler());
60 network_profile_handler_->Init(); 60 network_profile_handler_->Init();
61 61
62 managed_config_handler_.reset(new ManagedNetworkConfigurationHandlerImpl()); 62 managed_config_handler_.reset(new ManagedNetworkConfigurationHandlerImpl());
63 prohibited_technologies_handler_.reset(new ProhibitedTechnologiesHandler()); 63 prohibited_technologies_handler_.reset(new ProhibitedTechnologiesHandler());
64 64
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 network_state_handler_->SetTechnologyEnabled( 186 network_state_handler_->SetTechnologyEnabled(
187 NetworkTypePattern::Cellular(), true, network_handler::ErrorCallback()); 187 NetworkTypePattern::Cellular(), true, network_handler::ErrorCallback());
188 base::RunLoop().RunUntilIdle(); 188 base::RunLoop().RunUntilIdle();
189 EXPECT_FALSE( 189 EXPECT_FALSE(
190 network_state_handler_->IsTechnologyEnabled(NetworkTypePattern::WiFi())); 190 network_state_handler_->IsTechnologyEnabled(NetworkTypePattern::WiFi()));
191 EXPECT_TRUE(network_state_handler_->IsTechnologyEnabled( 191 EXPECT_TRUE(network_state_handler_->IsTechnologyEnabled(
192 NetworkTypePattern::Cellular())); 192 NetworkTypePattern::Cellular()));
193 } 193 }
194 194
195 } // namespace chromeos 195 } // namespace chromeos
OLDNEW
« chromeos/network/network_state_handler.cc ('K') | « chromeos/network/network_state_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698