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

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

Issue 219333002: Added method getCaptivePortalStatus to networkingPrivate extension. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 6 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 | Annotate | Revision Log
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 var callbackPass = chrome.test.callbackPass; 5 var callbackPass = chrome.test.callbackPass;
6 var callbackFail = chrome.test.callbackFail; 6 var callbackFail = chrome.test.callbackFail;
7 var assertTrue = chrome.test.assertTrue; 7 var assertTrue = chrome.test.assertTrue;
8 var assertFalse = chrome.test.assertFalse; 8 var assertFalse = chrome.test.assertFalse;
9 var assertEq = chrome.test.assertEq; 9 var assertEq = chrome.test.assertEq;
10 10
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 callbackPass(function(result) { 374 callbackPass(function(result) {
375 assertEq("Connected", result); 375 assertEq("Connected", result);
376 })); 376 }));
377 }, 377 },
378 function getWifiTDLSStatus() { 378 function getWifiTDLSStatus() {
379 chrome.networkingPrivate.getWifiTDLSStatus( 379 chrome.networkingPrivate.getWifiTDLSStatus(
380 "aa:bb:cc:dd:ee:ff", 380 "aa:bb:cc:dd:ee:ff",
381 callbackPass(function(result) { 381 callbackPass(function(result) {
382 assertEq("Connected", result); 382 assertEq("Connected", result);
383 })); 383 }));
384 },
385 function getCaptivePortalStatus() {
386 var networks = [['stub_ethernet', 'Online'],
387 ['stub_wifi1', 'Offline'],
388 ['stub_wifi2', 'Portal'],
389 ['stub_cellular1', 'ProxyAuthRequired'],
390 ['stub_vpn1', 'Unknown']];
391 networks.forEach(function(network) {
392 var servicePath = network[0];
393 var expectedStatus = network[1];
394 chrome.networkingPrivate.getCaptivePortalStatus(
395 servicePath,
396 callbackPass(function(status) {
397 assertEq(expectedStatus, status);
398 }));
399 });
384 } 400 }
385 ]; 401 ];
386 402
387 var testToRun = window.location.search.substring(1); 403 var testToRun = window.location.search.substring(1);
388 chrome.test.runTests(availableTests.filter(function(op) { 404 chrome.test.runTests(availableTests.filter(function(op) {
389 return op.name == testToRun; 405 return op.name == testToRun;
390 })); 406 }));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698