Chromium Code Reviews| Index: chrome/test/data/extensions/api_test/networking/test.js |
| diff --git a/chrome/test/data/extensions/api_test/networking/test.js b/chrome/test/data/extensions/api_test/networking/test.js |
| index c08d96286ea46b00e9ec8260ac4bc251b8ce8ba0..4a04f39c1ae2e79746e3040872bdfabb2930336e 100644 |
| --- a/chrome/test/data/extensions/api_test/networking/test.js |
| +++ b/chrome/test/data/extensions/api_test/networking/test.js |
| @@ -121,6 +121,48 @@ var availableTests = [ |
| })); |
| })); |
| }, |
| + function getNetworks() { |
| + // Test 'type' and 'configured'. |
|
pneubeck (no reviews)
2014/05/15 18:28:37
testing 'visible: true' too?
stevenjb
2014/05/15 20:12:41
Hmm, we're not actually testing that and should, I
|
| + chrome.networkingPrivate.getNetworks( |
| + { "type": "WiFi", "visible": false, "configured": true }, |
| + callbackPass(function(result) { |
| + assertEq([{ |
| + "Connectable": true, |
| + "ConnectionState": "Connected", |
|
pneubeck (no reviews)
2014/05/15 18:28:37
if such network states are common over several tes
stevenjb
2014/05/15 20:12:41
If I did that I'd want to move the entire default
|
| + "GUID": "stub_wifi1", |
| + "Name": "wifi1", |
| + "Type": "WiFi", |
| + "WiFi": { |
| + "Security": "WEP-PSK", |
| + "SignalStrength": 40 |
| + } |
| + }, { |
| + "Connectable": true, |
| + "ConnectionState": "NotConnected", |
| + "GUID": "stub_wifi2", |
| + "Name": "wifi2_PSK", |
| + "Type": "WiFi", |
| + "WiFi": { |
| + "Security": "WPA-PSK", |
| + "SignalStrength": 80 |
| + } |
| + }], result); |
| + // Test 'limit'. |
| + chrome.networkingPrivate.getNetworks( |
| + { "type": "All", "visible": false, "configured": true, "limit": 1 }, |
| + callbackPass(function(result) { |
| + assertEq([{ |
| + "ConnectionState": "Connected", |
| + "Ethernet": { |
| + "Authentication": "None" |
| + }, |
| + "GUID": "stub_ethernet", |
| + "Name": "eth0", |
| + "Type": "Ethernet" |
| + }], result); |
| + })); |
| + })); |
| + }, |
| function getVisibleNetworks() { |
| chrome.networkingPrivate.getVisibleNetworks( |
| "All", |
| @@ -149,7 +191,7 @@ var availableTests = [ |
| "ConnectionState": "Connected", |
| "GUID": "stub_vpn1", |
| "Name": "vpn1", |
| - "Type": "VPN", |
| + "Type": "VPN" |
| }, |
| { |
| "Connectable": true, |
| @@ -298,23 +340,25 @@ var availableTests = [ |
| var done = chrome.test.callbackAdded(); |
| var network_guid = "stub_wifi2"; |
| chrome.networkingPrivate.getProperties( |
| - network_guid, |
| - callbackPass(function(result) { |
| - assertEq(network_guid, result.GUID); |
| - result.WiFi.Security = "WEP-PSK"; |
| - chrome.networkingPrivate.setProperties("stub_wifi2", result, |
| - callbackPass(function() { |
| - chrome.networkingPrivate.getProperties( |
| - "stub_wifi2", |
| - callbackPass(function(result) { |
| - // Ensure that the property was set. |
| - assertEq("WEP-PSK", result.WiFi.Security); |
| - // Ensure that the GUID doesn't change. |
| - assertEq(network_guid, result.GUID); |
| - done(); |
| + network_guid, |
| + callbackPass(function(result) { |
| + assertEq(network_guid, result.GUID); |
| + result.WiFi.Security = "WEP-PSK"; |
| + chrome.networkingPrivate.setProperties( |
| + network_guid, |
| + result, |
| + callbackPass(function() { |
| + chrome.networkingPrivate.getProperties( |
| + network_guid, |
| + callbackPass(function(result) { |
| + // Ensure that the property was set. |
| + assertEq("WEP-PSK", result.WiFi.Security); |
| + // Ensure that the GUID doesn't change. |
| + assertEq(network_guid, result.GUID); |
| + done(); |
| + })); |
| })); |
| - })); |
| - })); |
| + })); |
| }, |
| function getState() { |
| chrome.networkingPrivate.getState( |