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 598 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 }, | |
632 function onNetworksChangedEventConnect() { | 619 function onNetworksChangedEventConnect() { |
633 var network = 'stub_wifi2_guid'; | 620 var network = 'stub_wifi2_guid'; |
634 var done = chrome.test.callbackAdded(); | 621 var done = chrome.test.callbackAdded(); |
635 var expectedStates = [ConnectionStateType.CONNECTED]; | 622 var expectedStates = [ConnectionStateType.CONNECTED]; |
636 var listener = | 623 var listener = |
637 new privateHelpers.watchForStateChanges(network, expectedStates, done); | 624 new privateHelpers.watchForStateChanges(network, expectedStates, done); |
638 chrome.networkingPrivate.startConnect(network, callbackPass()); | 625 chrome.networkingPrivate.startConnect(network, callbackPass()); |
639 }, | 626 }, |
640 function onNetworksChangedEventDisconnect() { | 627 function onNetworksChangedEventDisconnect() { |
641 var network = 'stub_wifi1_guid'; | 628 var network = 'stub_wifi1_guid'; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 new privateHelpers.watchForCaptivePortalState( | 714 new privateHelpers.watchForCaptivePortalState( |
728 'wifi_guid', 'Online', done); | 715 'wifi_guid', 'Online', done); |
729 chrome.test.sendMessage('notifyPortalDetectorObservers'); | 716 chrome.test.sendMessage('notifyPortalDetectorObservers'); |
730 }, | 717 }, |
731 ]; | 718 ]; |
732 | 719 |
733 var testToRun = window.location.search.substring(1); | 720 var testToRun = window.location.search.substring(1); |
734 chrome.test.runTests(availableTests.filter(function(op) { | 721 chrome.test.runTests(availableTests.filter(function(op) { |
735 return op.name == testToRun; | 722 return op.name == testToRun; |
736 })); | 723 })); |
OLD | NEW |