OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // The expectations in this test for the Chrome OS implementation. See | 5 // The expectations in this test for the Chrome OS implementation. See |
6 // networking_private_chromeos_apitest.cc for more info. | 6 // networking_private_chromeos_apitest.cc for more info. |
7 | 7 |
8 var callbackPass = chrome.test.callbackPass; | 8 var callbackPass = chrome.test.callbackPass; |
9 var callbackFail = chrome.test.callbackFail; | 9 var callbackFail = chrome.test.callbackFail; |
10 var assertTrue = chrome.test.assertTrue; | 10 var assertTrue = chrome.test.assertTrue; |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
236 GUID: 'stub_ethernet_guid', | 236 GUID: 'stub_ethernet_guid', |
237 Name: 'eth0', | 237 Name: 'eth0', |
238 Source: 'Device', | 238 Source: 'Device', |
239 Type: NetworkType.ETHERNET | 239 Type: NetworkType.ETHERNET |
240 }], result); | 240 }], result); |
241 })); | 241 })); |
242 })); | 242 })); |
243 })); | 243 })); |
244 }, | 244 }, |
245 function getVisibleNetworks() { | 245 function getVisibleNetworks() { |
246 chrome.networkingPrivate.getVisibleNetworks( | 246 chrome.networkingPrivate.getVisibleNetworks( |
pneubeck (no reviews)
2015/04/14 17:37:15
would the ErrorState (from shill error or lasterro
stevenjb
2015/04/14 18:27:17
Actually, I am going to change the code that Error
| |
247 NetworkType.ALL, | 247 NetworkType.ALL, |
248 callbackPass(function(result) { | 248 callbackPass(function(result) { |
249 assertEq([{ | 249 assertEq([{ |
250 ConnectionState: ConnectionStateType.CONNECTED, | 250 ConnectionState: ConnectionStateType.CONNECTED, |
251 Ethernet: { | 251 Ethernet: { |
252 Authentication: 'None' | 252 Authentication: 'None' |
253 }, | 253 }, |
254 GUID: 'stub_ethernet_guid', | 254 GUID: 'stub_ethernet_guid', |
255 Name: 'eth0', | 255 Name: 'eth0', |
256 Source: 'Device', | 256 Source: 'Device', |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
609 SignalStrength: 80 | 609 SignalStrength: 80 |
610 } | 610 } |
611 }, result); | 611 }, result); |
612 })); | 612 })); |
613 }, | 613 }, |
614 function getStateNonExistent() { | 614 function getStateNonExistent() { |
615 chrome.networkingPrivate.getState( | 615 chrome.networkingPrivate.getState( |
616 'non_existent', | 616 'non_existent', |
617 callbackFail('Error.InvalidNetworkGuid')); | 617 callbackFail('Error.InvalidNetworkGuid')); |
618 }, | 618 }, |
619 function getErrorState() { | |
620 // Both getState and getProperties should have ErrorState set. | |
621 chrome.networkingPrivate.getState( | |
622 'stub_wifi1_guid', | |
623 function(result) { | |
624 assertEq('TestErrorState', result.ErrorState); | |
625 chrome.networkingPrivate.getProperties( | |
626 'stub_wifi1_guid', | |
627 callbackPass(function(result2) { | |
628 assertEq('TestErrorState', result2.ErrorState); | |
629 })); | |
630 }); | |
631 }, | |
619 function onNetworksChangedEventConnect() { | 632 function onNetworksChangedEventConnect() { |
620 var network = 'stub_wifi2_guid'; | 633 var network = 'stub_wifi2_guid'; |
621 var done = chrome.test.callbackAdded(); | 634 var done = chrome.test.callbackAdded(); |
622 var expectedStates = [ConnectionStateType.CONNECTED]; | 635 var expectedStates = [ConnectionStateType.CONNECTED]; |
623 var listener = | 636 var listener = |
624 new privateHelpers.watchForStateChanges(network, expectedStates, done); | 637 new privateHelpers.watchForStateChanges(network, expectedStates, done); |
625 chrome.networkingPrivate.startConnect(network, callbackPass()); | 638 chrome.networkingPrivate.startConnect(network, callbackPass()); |
626 }, | 639 }, |
627 function onNetworksChangedEventDisconnect() { | 640 function onNetworksChangedEventDisconnect() { |
628 var network = 'stub_wifi1_guid'; | 641 var network = 'stub_wifi1_guid'; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
714 new privateHelpers.watchForCaptivePortalState( | 727 new privateHelpers.watchForCaptivePortalState( |
715 'wifi_guid', 'Online', done); | 728 'wifi_guid', 'Online', done); |
716 chrome.test.sendMessage('notifyPortalDetectorObservers'); | 729 chrome.test.sendMessage('notifyPortalDetectorObservers'); |
717 }, | 730 }, |
718 ]; | 731 ]; |
719 | 732 |
720 var testToRun = window.location.search.substring(1); | 733 var testToRun = window.location.search.substring(1); |
721 chrome.test.runTests(availableTests.filter(function(op) { | 734 chrome.test.runTests(availableTests.filter(function(op) { |
722 return op.name == testToRun; | 735 return op.name == testToRun; |
723 })); | 736 })); |
OLD | NEW |