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

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

Issue 1059033002: Implement networkingPrivate.getDeviceStates (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 Name: 'wifi2_PSK', 333 Name: 'wifi2_PSK',
334 Source: 'User', 334 Source: 'User',
335 Type: NetworkType.WiFi, 335 Type: NetworkType.WiFi,
336 WiFi: { 336 WiFi: {
337 Security: 'WPA-PSK', 337 Security: 'WPA-PSK',
338 SignalStrength: 80 338 SignalStrength: 80
339 } 339 }
340 }], result); 340 }], result);
341 })); 341 }));
342 }, 342 },
343 function getDeviceStates() {
344 chrome.networkingPrivate.getDeviceStates(callbackPass(function(result) {
345 assertEq([
346 {State: 'Uninitialized', Type: 'Cellular'},
347 {State: 'Enabled', Type: 'Ethernet'},
348 {State: 'Enabled', Type: 'WiFi'},
349 {State: 'Disabled', Type: 'WiMAX'},
350 ],
351 result);
352 }));
353 },
343 function requestNetworkScan() { 354 function requestNetworkScan() {
344 // Connected or Connecting networks should be listed first, sorted by type. 355 // Connected or Connecting networks should be listed first, sorted by type.
345 var expected = ['stub_ethernet_guid', 356 var expected = ['stub_ethernet_guid',
346 'stub_wifi1_guid', 357 'stub_wifi1_guid',
347 'stub_wimax_guid', 358 'stub_wimax_guid',
348 'stub_vpn1_guid', 359 'stub_vpn1_guid',
349 'stub_vpn2_guid', 360 'stub_vpn2_guid',
350 'stub_wifi2_guid']; 361 'stub_wifi2_guid'];
351 var done = chrome.test.callbackAdded(); 362 var done = chrome.test.callbackAdded();
352 var listener = new privateHelpers.listListener(expected, done); 363 var listener = new privateHelpers.listListener(expected, done);
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 new privateHelpers.watchForCaptivePortalState( 685 new privateHelpers.watchForCaptivePortalState(
675 'wifi_guid', 'Online', done); 686 'wifi_guid', 'Online', done);
676 chrome.test.sendMessage('notifyPortalDetectorObservers'); 687 chrome.test.sendMessage('notifyPortalDetectorObservers');
677 }, 688 },
678 ]; 689 ];
679 690
680 var testToRun = window.location.search.substring(1); 691 var testToRun = window.location.search.substring(1);
681 chrome.test.runTests(availableTests.filter(function(op) { 692 chrome.test.runTests(availableTests.filter(function(op) {
682 return op.name == testToRun; 693 return op.name == testToRun;
683 })); 694 }));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698