| OLD | NEW |
| 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 <string> | 7 #include <string> |
| 8 #include <utility> |
| 8 | 9 |
| 9 #include "base/bind.h" | 10 #include "base/bind.h" |
| 10 #include "base/callback.h" | 11 #include "base/callback.h" |
| 11 #include "base/json/json_reader.h" | 12 #include "base/json/json_reader.h" |
| 12 #include "base/macros.h" | 13 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
| 15 #include "base/run_loop.h" | 16 #include "base/run_loop.h" |
| 16 #include "chromeos/dbus/dbus_thread_manager.h" | 17 #include "chromeos/dbus/dbus_thread_manager.h" |
| 17 #include "chromeos/dbus/shill_manager_client.h" | 18 #include "chromeos/dbus/shill_manager_client.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 network_state_handler_.get()); | 71 network_state_handler_.get()); |
| 71 | 72 |
| 72 base::RunLoop().RunUntilIdle(); | 73 base::RunLoop().RunUntilIdle(); |
| 73 | 74 |
| 74 PreparePolicies(); | 75 PreparePolicies(); |
| 75 } | 76 } |
| 76 | 77 |
| 77 void PreparePolicies() { | 78 void PreparePolicies() { |
| 78 scoped_ptr<base::ListValue> val(new base::ListValue()); | 79 scoped_ptr<base::ListValue> val(new base::ListValue()); |
| 79 val->AppendString("WiFi"); | 80 val->AppendString("WiFi"); |
| 80 global_config_disable_wifi.Set("DisableNetworkTypes", val.Pass()); | 81 global_config_disable_wifi.Set("DisableNetworkTypes", std::move(val)); |
| 81 val.reset(new base::ListValue()); | 82 val.reset(new base::ListValue()); |
| 82 val->AppendString("WiFi"); | 83 val->AppendString("WiFi"); |
| 83 val->AppendString("Cellular"); | 84 val->AppendString("Cellular"); |
| 84 global_config_disable_wifi_and_cell.Set("DisableNetworkTypes", val.Pass()); | 85 global_config_disable_wifi_and_cell.Set("DisableNetworkTypes", |
| 86 std::move(val)); |
| 85 } | 87 } |
| 86 | 88 |
| 87 void TearDown() override { | 89 void TearDown() override { |
| 88 prohibited_technologies_handler_.reset(); | 90 prohibited_technologies_handler_.reset(); |
| 89 managed_config_handler_.reset(); | 91 managed_config_handler_.reset(); |
| 90 network_profile_handler_.reset(); | 92 network_profile_handler_.reset(); |
| 91 network_config_handler_.reset(); | 93 network_config_handler_.reset(); |
| 92 network_state_handler_.reset(); | 94 network_state_handler_.reset(); |
| 93 LoginState::Shutdown(); | 95 LoginState::Shutdown(); |
| 94 DBusThreadManager::Shutdown(); | 96 DBusThreadManager::Shutdown(); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 network_state_handler_->SetTechnologyEnabled( | 184 network_state_handler_->SetTechnologyEnabled( |
| 183 NetworkTypePattern::Cellular(), true, network_handler::ErrorCallback()); | 185 NetworkTypePattern::Cellular(), true, network_handler::ErrorCallback()); |
| 184 message_loop_.RunUntilIdle(); | 186 message_loop_.RunUntilIdle(); |
| 185 EXPECT_FALSE( | 187 EXPECT_FALSE( |
| 186 network_state_handler_->IsTechnologyEnabled(NetworkTypePattern::WiFi())); | 188 network_state_handler_->IsTechnologyEnabled(NetworkTypePattern::WiFi())); |
| 187 EXPECT_TRUE(network_state_handler_->IsTechnologyEnabled( | 189 EXPECT_TRUE(network_state_handler_->IsTechnologyEnabled( |
| 188 NetworkTypePattern::Cellular())); | 190 NetworkTypePattern::Cellular())); |
| 189 }; | 191 }; |
| 190 | 192 |
| 191 } // namespace chromeos | 193 } // namespace chromeos |
| OLD | NEW |