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

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

Issue 2754903002: Prevent networkingPrivate.forgetNetwork from removing shared configs (Closed)
Patch Set: . Created 3 years, 8 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
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 // The expectations in this test for the Chrome OS implementation. See 5 // The expectations in this test for the Chrome OS implementation. See
6 // networking_private_chromeos_apitest.cc for more info. 6 // networking_private_chromeos_apitest.cc for more info.
7 7
8 var callbackPass = chrome.test.callbackPass; 8 var callbackPass = chrome.test.callbackPass;
9 var callbackFail = chrome.test.callbackFail; 9 var callbackFail = chrome.test.callbackFail;
10 var assertTrue = chrome.test.assertTrue; 10 var assertTrue = chrome.test.assertTrue;
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 chrome.networkingPrivate.forgetNetwork( 220 chrome.networkingPrivate.forgetNetwork(
221 kTestNetworkGuid, callbackPass(function() { 221 kTestNetworkGuid, callbackPass(function() {
222 chrome.networkingPrivate.getNetworks( 222 chrome.networkingPrivate.getNetworks(
223 filter, callbackPass(function(networks) { 223 filter, callbackPass(function(networks) {
224 assertEq(kNumNetworks - 1, networks.length); 224 assertEq(kNumNetworks - 1, networks.length);
225 assertFalse(guidExists(networks, kTestNetworkGuid)); 225 assertFalse(guidExists(networks, kTestNetworkGuid));
226 })); 226 }));
227 })); 227 }));
228 })); 228 }));
229 }, 229 },
230 function forgetPolicyControlledNetwork() {
231 chrome.networkingPrivate.getProperties('stub_wifi2', callbackPass(function(
232 properties) {
233 // Sanity check to verify there is a policy defined config for the network
234 // config that will be set up in this test.
235 chrome.test.assertEq('UserPolicy', properties.Source);
236 chrome.test.assertEq('WiFi', properties.Type);
237 chrome.test.assertEq('WPA-PSK', properties.WiFi.Security);
238 chrome.test.assertEq('wifi2_PSK', properties.WiFi.SSID);
239
240 chrome.networkingPrivate.forgetNetwork(
241 'stub_wifi2', callbackFail('Error.PolicyControlled'));
242 }));
243 },
230 function getNetworks() { 244 function getNetworks() {
231 // Test 'type' and 'configured'. 245 // Test 'type' and 'configured'.
232 var filter = { 246 var filter = {
233 networkType: NetworkType.WI_FI, 247 networkType: NetworkType.WI_FI,
234 configured: true 248 configured: true
235 }; 249 };
236 chrome.networkingPrivate.getNetworks( 250 chrome.networkingPrivate.getNetworks(
237 filter, 251 filter,
238 callbackPass(function(result) { 252 callbackPass(function(result) {
239 assertEq([{ 253 assertEq([{
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
909 var tests = availableTests.filter(function(op) { 923 var tests = availableTests.filter(function(op) {
910 return args.test == op.name; 924 return args.test == op.name;
911 }); 925 });
912 if (tests.length !== 1) { 926 if (tests.length !== 1) {
913 chrome.test.notifyFail('Test not found ' + args.test); 927 chrome.test.notifyFail('Test not found ' + args.test);
914 return; 928 return;
915 } 929 }
916 930
917 chrome.test.runTests(tests); 931 chrome.test.runTests(tests);
918 }); 932 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698