OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "chrome/browser/chromeos/cros/cros_network_functions.h" | 8 #include "chrome/browser/chromeos/cros/cros_network_functions.h" |
9 #include "chrome/browser/chromeos/cros/gvalue_util.h" | 9 #include "chrome/browser/chromeos/cros/gvalue_util.h" |
10 #include "chrome/browser/chromeos/cros/mock_chromeos_network.h" | 10 #include "chrome/browser/chromeos/cros/mock_chromeos_network.h" |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 } | 598 } |
599 | 599 |
600 TEST_F(CrosNetworkFunctionsLibcrosTest, CrosRequestNetworkDeviceEnable) { | 600 TEST_F(CrosNetworkFunctionsLibcrosTest, CrosRequestNetworkDeviceEnable) { |
601 const bool kEnable = true; | 601 const bool kEnable = true; |
602 EXPECT_CALL(*MockChromeOSNetwork::Get(), | 602 EXPECT_CALL(*MockChromeOSNetwork::Get(), |
603 RequestNetworkDeviceEnable(StrEq(flimflam::kTypeWifi), kEnable)) | 603 RequestNetworkDeviceEnable(StrEq(flimflam::kTypeWifi), kEnable)) |
604 .Times(1); | 604 .Times(1); |
605 CrosRequestNetworkDeviceEnable(flimflam::kTypeWifi, kEnable); | 605 CrosRequestNetworkDeviceEnable(flimflam::kTypeWifi, kEnable); |
606 } | 606 } |
607 | 607 |
| 608 TEST_F(CrosNetworkFunctionsLibcrosTest, CrosProposeScan) { |
| 609 const std::string device_path = "/device/path"; |
| 610 EXPECT_CALL(*MockChromeOSNetwork::Get(), ProposeScan(StrEq(device_path))) |
| 611 .Times(1); |
| 612 CrosProposeScan(device_path); |
| 613 } |
| 614 |
608 TEST_F(CrosNetworkFunctionsLibcrosTest, CrosAddIPConfig) { | 615 TEST_F(CrosNetworkFunctionsLibcrosTest, CrosAddIPConfig) { |
609 const std::string device_path = "/device/path"; | 616 const std::string device_path = "/device/path"; |
610 EXPECT_CALL(*MockChromeOSNetwork::Get(), | 617 EXPECT_CALL(*MockChromeOSNetwork::Get(), |
611 AddIPConfig(StrEq(device_path), IPCONFIG_TYPE_DHCP)).Times(1); | 618 AddIPConfig(StrEq(device_path), IPCONFIG_TYPE_DHCP)).Times(1); |
612 CrosAddIPConfig(device_path, IPCONFIG_TYPE_DHCP); | 619 CrosAddIPConfig(device_path, IPCONFIG_TYPE_DHCP); |
613 } | 620 } |
614 | 621 |
615 TEST_F(CrosNetworkFunctionsLibcrosTest, CrosRemoveIPConfig) { | 622 TEST_F(CrosNetworkFunctionsLibcrosTest, CrosRemoveIPConfig) { |
616 IPConfig config = {}; | 623 IPConfig config = {}; |
617 config.path = "/path"; | 624 config.path = "/path"; |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1112 EXPECT_CALL(*mock_manager_client_, | 1119 EXPECT_CALL(*mock_manager_client_, |
1113 EnableTechnology(flimflam::kTypeWifi, _)).Times(1); | 1120 EnableTechnology(flimflam::kTypeWifi, _)).Times(1); |
1114 CrosRequestNetworkDeviceEnable(flimflam::kTypeWifi, kEnable); | 1121 CrosRequestNetworkDeviceEnable(flimflam::kTypeWifi, kEnable); |
1115 | 1122 |
1116 const bool kDisable = false; | 1123 const bool kDisable = false; |
1117 EXPECT_CALL(*mock_manager_client_, | 1124 EXPECT_CALL(*mock_manager_client_, |
1118 DisableTechnology(flimflam::kTypeWifi, _)).Times(1); | 1125 DisableTechnology(flimflam::kTypeWifi, _)).Times(1); |
1119 CrosRequestNetworkDeviceEnable(flimflam::kTypeWifi, kDisable); | 1126 CrosRequestNetworkDeviceEnable(flimflam::kTypeWifi, kDisable); |
1120 } | 1127 } |
1121 | 1128 |
| 1129 TEST_F(CrosNetworkFunctionsTest, CrosProposeScan) { |
| 1130 const std::string device_path = "/device/path"; |
| 1131 EXPECT_CALL(*mock_device_client_, |
| 1132 ProposeScan(dbus::ObjectPath(device_path), _)).Times(1); |
| 1133 CrosProposeScan(device_path); |
| 1134 } |
| 1135 |
1122 TEST_F(CrosNetworkFunctionsTest, CrosAddIPConfig) { | 1136 TEST_F(CrosNetworkFunctionsTest, CrosAddIPConfig) { |
1123 const std::string device_path = "/device/path"; | 1137 const std::string device_path = "/device/path"; |
1124 const dbus::ObjectPath result_path("/result/path"); | 1138 const dbus::ObjectPath result_path("/result/path"); |
1125 EXPECT_CALL(*mock_device_client_, | 1139 EXPECT_CALL(*mock_device_client_, |
1126 CallAddIPConfigAndBlock(dbus::ObjectPath(device_path), | 1140 CallAddIPConfigAndBlock(dbus::ObjectPath(device_path), |
1127 flimflam::kTypeDHCP)) | 1141 flimflam::kTypeDHCP)) |
1128 .WillOnce(Return(result_path)); | 1142 .WillOnce(Return(result_path)); |
1129 EXPECT_TRUE(CrosAddIPConfig(device_path, IPCONFIG_TYPE_DHCP)); | 1143 EXPECT_TRUE(CrosAddIPConfig(device_path, IPCONFIG_TYPE_DHCP)); |
1130 } | 1144 } |
1131 | 1145 |
(...skipping 12 matching lines...) Expand all Loading... |
1144 const std::string string2 = "string2"; | 1158 const std::string string2 = "string2"; |
1145 base::DictionaryValue value; | 1159 base::DictionaryValue value; |
1146 value.SetString(key1, string1); | 1160 value.SetString(key1, string1); |
1147 value.SetString(key2, string2); | 1161 value.SetString(key2, string2); |
1148 EXPECT_CALL(*mock_manager_client_, ConfigureService(IsEqualTo(&value), _)) | 1162 EXPECT_CALL(*mock_manager_client_, ConfigureService(IsEqualTo(&value), _)) |
1149 .Times(1); | 1163 .Times(1); |
1150 CrosConfigureService(value); | 1164 CrosConfigureService(value); |
1151 } | 1165 } |
1152 | 1166 |
1153 } // namespace chromeos | 1167 } // namespace chromeos |
OLD | NEW |