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 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 base::Bind(&UpdatePortaledWifiState, | 719 base::Bind(&UpdatePortaledWifiState, |
720 "portaled_wifi")); | 720 "portaled_wifi")); |
721 services->SetServiceProperty(kPortaledWifiPath, | 721 services->SetServiceProperty(kPortaledWifiPath, |
722 shill::kConnectableProperty, | 722 shill::kConnectableProperty, |
723 base::FundamentalValue(true)); | 723 base::FundamentalValue(true)); |
724 profiles->AddService(shared_profile, kPortaledWifiPath); | 724 profiles->AddService(shared_profile, kPortaledWifiPath); |
725 } | 725 } |
726 } | 726 } |
727 | 727 |
728 // Wimax | 728 // Wimax |
| 729 const std::string kWimaxPath = "/service/wimax1"; |
729 state = GetInitialStateForType(shill::kTypeWimax, &enabled); | 730 state = GetInitialStateForType(shill::kTypeWimax, &enabled); |
730 if (state != kTechnologyUnavailable) { | 731 if (state != kTechnologyUnavailable) { |
731 AddTechnology(shill::kTypeWimax, enabled); | 732 AddTechnology(shill::kTypeWimax, enabled); |
732 devices->AddDevice( | 733 devices->AddDevice( |
733 "/device/wimax1", shill::kTypeWimax, "stub_wimax_device1"); | 734 "/device/wimax1", shill::kTypeWimax, "stub_wimax_device1"); |
734 | 735 |
735 services->AddService("/service/wimax1", | 736 services->AddService(kWimaxPath, "wimax1_guid", "wimax1" /* name */, |
736 "wimax1_guid", | 737 shill::kTypeWimax, state, add_to_visible); |
737 "wimax1" /* name */, | 738 services->SetServiceProperty(kWimaxPath, shill::kConnectableProperty, |
738 shill::kTypeWimax, | |
739 state, | |
740 add_to_visible); | |
741 services->SetServiceProperty("/service/wimax1", | |
742 shill::kConnectableProperty, | |
743 base::FundamentalValue(true)); | 739 base::FundamentalValue(true)); |
744 base::FundamentalValue strength_value(80); | 740 base::FundamentalValue strength_value(80); |
745 services->SetServiceProperty( | 741 services->SetServiceProperty(kWimaxPath, shill::kSignalStrengthProperty, |
746 "/service/wimax1", shill::kSignalStrengthProperty, strength_value); | 742 strength_value); |
747 base::StringValue identity_value("test.identity"); | 743 profiles->AddService(shared_profile, kWimaxPath); |
748 services->SetServiceProperty( | |
749 "/service/wimax1", shill::kEapIdentityProperty, identity_value); | |
750 } | 744 } |
751 | 745 |
752 // Cellular | 746 // Cellular |
753 state = GetInitialStateForType(shill::kTypeCellular, &enabled); | 747 state = GetInitialStateForType(shill::kTypeCellular, &enabled); |
754 if (state != kTechnologyUnavailable) { | 748 if (state != kTechnologyUnavailable) { |
755 bool activated = false; | 749 bool activated = false; |
756 if (state == kNetworkActivated) { | 750 if (state == kNetworkActivated) { |
757 activated = true; | 751 activated = true; |
758 state = shill::kStateIdle; | 752 state = shill::kStateIdle; |
759 } | 753 } |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1129 *enabled = true; | 1123 *enabled = true; |
1130 if ((state == shill::kStatePortal && type != shill::kTypeWifi) || | 1124 if ((state == shill::kStatePortal && type != shill::kTypeWifi) || |
1131 (state == kNetworkActivated && type != shill::kTypeCellular)) { | 1125 (state == kNetworkActivated && type != shill::kTypeCellular)) { |
1132 LOG(WARNING) << "Invalid state: " << state << " for " << type; | 1126 LOG(WARNING) << "Invalid state: " << state << " for " << type; |
1133 return shill::kStateIdle; | 1127 return shill::kStateIdle; |
1134 } | 1128 } |
1135 return state; | 1129 return state; |
1136 } | 1130 } |
1137 | 1131 |
1138 } // namespace chromeos | 1132 } // namespace chromeos |
OLD | NEW |