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 base::StringValue identity_value("test.identity"); |
748 services->SetServiceProperty( | 744 services->SetServiceProperty(kWimaxPath, shill::kEapIdentityProperty, |
749 "/service/wimax1", shill::kEapIdentityProperty, identity_value); | 745 identity_value); |
746 profiles->AddService(shared_profile, kWimaxPath); | |
pneubeck (no reviews)
2015/02/25 08:47:19
probably not an expected combination: wimax+eap+sh
stevenjb
2015/02/25 18:19:49
Removed the EAP property which isn't really set up
| |
750 } | 747 } |
751 | 748 |
752 // Cellular | 749 // Cellular |
753 state = GetInitialStateForType(shill::kTypeCellular, &enabled); | 750 state = GetInitialStateForType(shill::kTypeCellular, &enabled); |
754 if (state != kTechnologyUnavailable) { | 751 if (state != kTechnologyUnavailable) { |
755 bool activated = false; | 752 bool activated = false; |
756 if (state == kNetworkActivated) { | 753 if (state == kNetworkActivated) { |
757 activated = true; | 754 activated = true; |
758 state = shill::kStateIdle; | 755 state = shill::kStateIdle; |
759 } | 756 } |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1129 *enabled = true; | 1126 *enabled = true; |
1130 if ((state == shill::kStatePortal && type != shill::kTypeWifi) || | 1127 if ((state == shill::kStatePortal && type != shill::kTypeWifi) || |
1131 (state == kNetworkActivated && type != shill::kTypeCellular)) { | 1128 (state == kNetworkActivated && type != shill::kTypeCellular)) { |
1132 LOG(WARNING) << "Invalid state: " << state << " for " << type; | 1129 LOG(WARNING) << "Invalid state: " << state << " for " << type; |
1133 return shill::kStateIdle; | 1130 return shill::kStateIdle; |
1134 } | 1131 } |
1135 return state; | 1132 return state; |
1136 } | 1133 } |
1137 | 1134 |
1138 } // namespace chromeos | 1135 } // namespace chromeos |
OLD | NEW |