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 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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 "Name": "cellular1", | 309 "Name": "cellular1", |
310 "Type": "Cellular" | 310 "Type": "Cellular" |
311 }, result); | 311 }, result); |
312 })); | 312 })); |
313 }, | 313 }, |
314 function getManagedProperties() { | 314 function getManagedProperties() { |
315 chrome.networkingPrivate.getManagedProperties( | 315 chrome.networkingPrivate.getManagedProperties( |
316 "stub_wifi2", | 316 "stub_wifi2", |
317 callbackPass(function(result) { | 317 callbackPass(function(result) { |
318 assertEq({ | 318 assertEq({ |
319 "Connectable": { | 319 "Connectable": true, |
320 "Active": true, | 320 "ConnectionState": "NotConnected", |
321 "Effective": "Unmanaged" | |
322 }, | |
323 "ConnectionState": { | |
324 "Active": "NotConnected", | |
325 "Effective": "Unmanaged" | |
326 }, | |
327 "GUID": "stub_wifi2", | 321 "GUID": "stub_wifi2", |
328 "Name": { | 322 "Name": { |
329 "Active": "wifi2_PSK", | 323 "Active": "wifi2_PSK", |
330 "Effective": "UserPolicy", | 324 "Effective": "UserPolicy", |
331 "UserPolicy": "My WiFi Network" | 325 "UserPolicy": "My WiFi Network" |
332 }, | 326 }, |
333 "Type": { | 327 "Type": { |
334 "Active": "WiFi", | 328 "Active": "WiFi", |
335 "Effective": "UserPolicy", | 329 "Effective": "UserPolicy", |
336 "UserPolicy": "WiFi" | 330 "UserPolicy": "WiFi" |
337 }, | 331 }, |
338 "WiFi": { | 332 "WiFi": { |
339 "AutoConnect": { | 333 "AutoConnect": { |
340 "Active": false, | 334 "Active": false, |
341 "UserEditable": true | 335 "UserEditable": true |
342 }, | 336 }, |
343 "Frequency" : { | 337 "Frequency" : 5000, |
344 "Active": 5000, | 338 "FrequencyList" : [2400, 5000], |
345 "Effective": "Unmanaged" | |
346 }, | |
347 "FrequencyList" : { | |
348 "Active": [2400, 5000], | |
349 "Effective": "Unmanaged" | |
350 }, | |
351 "Passphrase": { | 339 "Passphrase": { |
352 "Effective": "UserSetting", | 340 "Effective": "UserSetting", |
353 "UserEditable": true, | 341 "UserEditable": true, |
354 "UserSetting": "FAKE_CREDENTIAL_VPaJDV9x" | 342 "UserSetting": "FAKE_CREDENTIAL_VPaJDV9x" |
355 }, | 343 }, |
356 "SSID": { | 344 "SSID": { |
357 "Active": "wifi2_PSK", | 345 "Active": "wifi2_PSK", |
358 "Effective": "UserPolicy", | 346 "Effective": "UserPolicy", |
359 "UserPolicy": "wifi2_PSK" | 347 "UserPolicy": "wifi2_PSK" |
360 }, | 348 }, |
361 "Security": { | 349 "Security": { |
362 "Active": "WPA-PSK", | 350 "Active": "WPA-PSK", |
363 "Effective": "UserPolicy", | 351 "Effective": "UserPolicy", |
364 "UserPolicy": "WPA-PSK" | 352 "UserPolicy": "WPA-PSK" |
365 }, | 353 }, |
366 "SignalStrength": { | 354 "SignalStrength": 80, |
367 "Active": 80, | |
368 "Effective": "Unmanaged" | |
369 } | |
370 } | 355 } |
371 }, result); | 356 }, result); |
372 })); | 357 })); |
373 }, | 358 }, |
374 function setProperties() { | 359 function setProperties() { |
375 var done = chrome.test.callbackAdded(); | 360 var done = chrome.test.callbackAdded(); |
376 var network_guid = "stub_wifi2_guid"; | 361 var network_guid = "stub_wifi2_guid"; |
377 chrome.networkingPrivate.getProperties( | 362 chrome.networkingPrivate.getProperties( |
378 network_guid, | 363 network_guid, |
379 callbackPass(function(result) { | 364 callbackPass(function(result) { |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 new privateHelpers.watchForCaptivePortalState( | 493 new privateHelpers.watchForCaptivePortalState( |
509 'wifi_guid', 'Online', done); | 494 'wifi_guid', 'Online', done); |
510 chrome.test.sendMessage('notifyPortalDetectorObservers'); | 495 chrome.test.sendMessage('notifyPortalDetectorObservers'); |
511 }, | 496 }, |
512 ]; | 497 ]; |
513 | 498 |
514 var testToRun = window.location.search.substring(1); | 499 var testToRun = window.location.search.substring(1); |
515 chrome.test.runTests(availableTests.filter(function(op) { | 500 chrome.test.runTests(availableTests.filter(function(op) { |
516 return op.name == testToRun; | 501 return op.name == testToRun; |
517 })); | 502 })); |
OLD | NEW |