Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(854)

Side by Side Diff: chrome/test/data/extensions/api_test/networking_private/chromeos/test.js

Issue 1043343002: Use networkingPrivate.startConnect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_430115_internet_options_cellular
Patch Set: Fix tests, add comment Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698