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

Side by Side Diff: chrome/test/data/extensions/api_test/networking/test.js

Issue 12541007: This adds the setProperties and getState functions to the networking API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Upload after merge Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 assertEq = chrome.test.assertEq; 8 var assertEq = chrome.test.assertEq;
9 9
10 // Test properties for the verification API. 10 // Test properties for the verification API.
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 "Name": "wifi2_PSK", 163 "Name": "wifi2_PSK",
164 "Type": "WiFi", 164 "Type": "WiFi",
165 "WiFi": { 165 "WiFi": {
166 "SSID": "stub_wifi2", 166 "SSID": "stub_wifi2",
167 "Security": "WPA-PSK", 167 "Security": "WPA-PSK",
168 "SignalStrength": 80 168 "SignalStrength": 80
169 } 169 }
170 }, result); 170 }, result);
171 })); 171 }));
172 }, 172 },
173 function setProperties() {
174 var done = chrome.test.callbackAdded();
175 chrome.networkingPrivate.getProperties(
176 "stub_wifi2",
177 function(result) {
178 result.WiFi.Security = "WEP-PSK";
179 chrome.networkingPrivate.setProperties("stub_wifi2", result,
180 function() {
181 chrome.networkingPrivate.getProperties(
182 "stub_wifi2",
183 function(result) {
184 assertEq("WEP-PSK", result.WiFi.Security);
185 done();
186 });
187 });
188 });
189 },
190 function getState() {
191 chrome.networkingPrivate.getState(
192 "stub_wifi2",
193 callbackPass(function(result) {
194 assertEq({
195 "ConnectionState": "NotConnected",
196 "GUID": "",
197 "Name": "wifi2_PSK",
198 "Type": "WiFi",
199 "WiFi": {
200 "Security": "WPA-PSK",
201 "SignalStrength": 80
202 }
203 }, result);
204 }));
205 },
173 function onNetworksChangedEventConnect() { 206 function onNetworksChangedEventConnect() {
174 var network = "stub_wifi2"; 207 var network = "stub_wifi2";
175 var done = chrome.test.callbackAdded(); 208 var done = chrome.test.callbackAdded();
176 var expectedStates = ["Connected", "Connecting"]; 209 var expectedStates = ["Connected", "Connecting"];
177 var listener = 210 var listener =
178 new privateHelpers.watchForStateChanges(network, expectedStates, done); 211 new privateHelpers.watchForStateChanges(network, expectedStates, done);
179 chrome.networkingPrivate.startConnect(network, callbackPass()); 212 chrome.networkingPrivate.startConnect(network, callbackPass());
180 }, 213 },
181 function onNetworksChangedEventDisconnect() { 214 function onNetworksChangedEventDisconnect() {
182 var network = "stub_wifi1"; 215 var network = "stub_wifi1";
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 callbackPass(function(result) { 254 callbackPass(function(result) {
222 assertEq("encrypted_data", result); 255 assertEq("encrypted_data", result);
223 })); 256 }));
224 } 257 }
225 ]; 258 ];
226 259
227 var testToRun = window.location.search.substring(1); 260 var testToRun = window.location.search.substring(1);
228 chrome.test.runTests(availableTests.filter(function(op) { 261 chrome.test.runTests(availableTests.filter(function(op) {
229 return op.name == testToRun; 262 return op.name == testToRun;
230 })); 263 }));
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/networking_private.json ('k') | chromeos/dbus/shill_manager_client_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698