OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/dbus/fake_shill_manager_client.h" | 5 #include "chromeos/dbus/fake_shill_manager_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 int FakeShillManagerClient::GetInteractiveDelay() const { | 558 int FakeShillManagerClient::GetInteractiveDelay() const { |
559 return interactive_delay_; | 559 return interactive_delay_; |
560 } | 560 } |
561 | 561 |
562 void FakeShillManagerClient::SetBestServiceToConnect( | 562 void FakeShillManagerClient::SetBestServiceToConnect( |
563 const std::string& service_path) { | 563 const std::string& service_path) { |
564 best_service_ = service_path; | 564 best_service_ = service_path; |
565 } | 565 } |
566 | 566 |
567 void FakeShillManagerClient::SetupDefaultEnvironment() { | 567 void FakeShillManagerClient::SetupDefaultEnvironment() { |
| 568 // Bail out from setup if there is no message loop. This will be the common |
| 569 // case for tests that are not testing Shill. |
| 570 if (!base::MessageLoop::current()) |
| 571 return; |
| 572 |
568 DBusThreadManager* dbus_manager = DBusThreadManager::Get(); | 573 DBusThreadManager* dbus_manager = DBusThreadManager::Get(); |
569 ShillServiceClient::TestInterface* services = | 574 ShillServiceClient::TestInterface* services = |
570 dbus_manager->GetShillServiceClient()->GetTestInterface(); | 575 dbus_manager->GetShillServiceClient()->GetTestInterface(); |
571 DCHECK(services); | 576 DCHECK(services); |
572 ShillProfileClient::TestInterface* profiles = | 577 ShillProfileClient::TestInterface* profiles = |
573 dbus_manager->GetShillProfileClient()->GetTestInterface(); | 578 dbus_manager->GetShillProfileClient()->GetTestInterface(); |
574 DCHECK(profiles); | 579 DCHECK(profiles); |
575 ShillDeviceClient::TestInterface* devices = | 580 ShillDeviceClient::TestInterface* devices = |
576 dbus_manager->GetShillDeviceClient()->GetTestInterface(); | 581 dbus_manager->GetShillDeviceClient()->GetTestInterface(); |
577 DCHECK(devices); | 582 DCHECK(devices); |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1079 *enabled = true; | 1084 *enabled = true; |
1080 if ((state == shill::kStatePortal && type != shill::kTypeWifi) || | 1085 if ((state == shill::kStatePortal && type != shill::kTypeWifi) || |
1081 (state == kNetworkActivated && type != shill::kTypeCellular)) { | 1086 (state == kNetworkActivated && type != shill::kTypeCellular)) { |
1082 LOG(WARNING) << "Invalid state: " << state << " for " << type; | 1087 LOG(WARNING) << "Invalid state: " << state << " for " << type; |
1083 return shill::kStateIdle; | 1088 return shill::kStateIdle; |
1084 } | 1089 } |
1085 return state; | 1090 return state; |
1086 } | 1091 } |
1087 | 1092 |
1088 } // namespace chromeos | 1093 } // namespace chromeos |
OLD | NEW |