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

Unified Diff: chrome/test/data/extensions/api_test/networking/test.js

Issue 280023003: Implement networkingPrivate.getNetworks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nonchromeos Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/api/networking_private.json ('k') | chromeos/dbus/fake_shill_manager_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..04e5c3a578651a85884abdc2aa9ff37fcc19fefc 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", "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 +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(
« no previous file with comments | « chrome/common/extensions/api/networking_private.json ('k') | chromeos/dbus/fake_shill_manager_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698