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 // Note: the expectations in this test are shared by both the Chrome OS and | 5 // Note: the expectations in this test are shared by both the Chrome OS and |
6 // Win/Mac (ServiceClient) implementations. TODO(stevenjb): Set up a way for | 6 // Win/Mac (ServiceClient) implementations. TODO(stevenjb): Set up a way for |
7 // the test code to specify the correct expectations. | 7 // the test code to specify the correct expectations. |
8 | 8 |
9 var callbackPass = chrome.test.callbackPass; | 9 var callbackPass = chrome.test.callbackPass; |
10 var callbackFail = chrome.test.callbackFail; | 10 var callbackFail = chrome.test.callbackFail; |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
373 }, result); | 373 }, result); |
374 })); | 374 })); |
375 }, | 375 }, |
376 function setProperties() { | 376 function setProperties() { |
377 var done = chrome.test.callbackAdded(); | 377 var done = chrome.test.callbackAdded(); |
378 var network_guid = "stub_wifi2_guid"; | 378 var network_guid = "stub_wifi2_guid"; |
379 chrome.networkingPrivate.getProperties( | 379 chrome.networkingPrivate.getProperties( |
380 network_guid, | 380 network_guid, |
381 callbackPass(function(result) { | 381 callbackPass(function(result) { |
382 assertEq(network_guid, result.GUID); | 382 assertEq(network_guid, result.GUID); |
383 result.WiFi.Security = "WEP-PSK"; | 383 var new_properties = {}; |
pneubeck (no reviews)
2014/11/13 17:38:56
wouldn't
var new_properties = {
Priority: 1,
W
stevenjb
2014/11/13 22:25:41
Yeah, probably. What can i say, I'm still a C++ pr
pneubeck (no reviews)
2014/11/14 08:17:02
:-)
| |
384 new_properties['Priority'] = 1; | |
385 var wifi = {}; | |
386 wifi['AutoConnect']= true; | |
387 new_properties['WiFi'] = wifi; | |
384 chrome.networkingPrivate.setProperties( | 388 chrome.networkingPrivate.setProperties( |
385 network_guid, | 389 network_guid, |
386 result, | 390 new_properties, |
387 callbackPass(function() { | 391 callbackPass(function() { |
388 chrome.networkingPrivate.getProperties( | 392 chrome.networkingPrivate.getProperties( |
389 network_guid, | 393 network_guid, |
390 callbackPass(function(result) { | 394 callbackPass(function(result) { |
391 // Ensure that the property was set. | 395 // Ensure that the properties were set. |
392 assertEq("WEP-PSK", result.WiFi.Security); | 396 assertEq(1, result['Priority']); |
397 assertEq(true, result['WiFi']['AutoConnect']); | |
393 // Ensure that the GUID doesn't change. | 398 // Ensure that the GUID doesn't change. |
394 assertEq(network_guid, result.GUID); | 399 assertEq(network_guid, result.GUID); |
395 done(); | 400 done(); |
396 })); | 401 })); |
397 })); | 402 })); |
398 })); | 403 })); |
399 }, | 404 }, |
400 function getState() { | 405 function getState() { |
401 chrome.networkingPrivate.getState( | 406 chrome.networkingPrivate.getState( |
402 "stub_wifi2_guid", | 407 "stub_wifi2_guid", |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
511 new privateHelpers.watchForCaptivePortalState( | 516 new privateHelpers.watchForCaptivePortalState( |
512 'wifi_guid', 'Online', done); | 517 'wifi_guid', 'Online', done); |
513 chrome.test.sendMessage('notifyPortalDetectorObservers'); | 518 chrome.test.sendMessage('notifyPortalDetectorObservers'); |
514 }, | 519 }, |
515 ]; | 520 ]; |
516 | 521 |
517 var testToRun = window.location.search.substring(1); | 522 var testToRun = window.location.search.substring(1); |
518 chrome.test.runTests(availableTests.filter(function(op) { | 523 chrome.test.runTests(availableTests.filter(function(op) { |
519 return op.name == testToRun; | 524 return op.name == testToRun; |
520 })); | 525 })); |
OLD | NEW |