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..4c21dcc6d8c16b6ebb7065ce936678f8f900b7eb 100644 |
| --- a/chrome/test/data/extensions/api_test/networking/test.js |
| +++ b/chrome/test/data/extensions/api_test/networking/test.js |
| @@ -121,6 +121,63 @@ var availableTests = [ |
| })); |
| })); |
| }, |
| + function getNetworks() { |
| + // Test 'type' and 'configured'. |
| + chrome.networkingPrivate.getNetworks( |
| + { "networkType": "WiFi", "configured": true }, |
| + callbackPass(function(result) { |
| + assertEq([{ |
| + "Connectable": true, |
| + "ConnectionState": "Connected", |
| + "GUID": "stub_wifi1", |
| + "Name": "wifi1", |
| + "Type": "WiFi", |
| + "WiFi": { |
| + "Security": "WEP-PSK", |
| + "SignalStrength": 40 |
| + } |
| + }, { |
| + "GUID": "stub_wifi2", |
| + "Name": "wifi2_PSK", |
| + "Type": "WiFi", |
| + "WiFi": { |
| + "Security": "WPA-PSK", |
| + } |
| + }], result); |
| + |
| + // Test 'visible' (and 'configured'). |
| + chrome.networkingPrivate.getNetworks( |
| + { "networkType": "WiFi", "visible": true, "configured": true }, |
| + callbackPass(function(result) { |
| + assertEq([{ |
| + "Connectable": true, |
| + "ConnectionState": "Connected", |
| + "GUID": "stub_wifi1", |
| + "Name": "wifi1", |
| + "Type": "WiFi", |
| + "WiFi": { |
| + "Security": "WEP-PSK", |
| + "SignalStrength": 40 |
| + } |
| + }], result); |
| + |
| + // Test 'limit'. |
| + chrome.networkingPrivate.getNetworks( |
| + { "networkType": "All", "configured": true, "limit": 1 }, |
|
pneubeck (no reviews)
2014/05/16 13:18:55
you should also have a test for 'configured:false'
stevenjb
2014/05/16 17:35:23
So, configured='false' is not the same as !configu
|
| + 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 +206,7 @@ var availableTests = [ |
| "ConnectionState": "Connected", |
| "GUID": "stub_vpn1", |
| "Name": "vpn1", |
| - "Type": "VPN", |
| + "Type": "VPN" |
| }, |
| { |
| "Connectable": true, |
| @@ -298,23 +355,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( |