Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 132 chrome.networkingPrivate.getProperties( | 132 chrome.networkingPrivate.getProperties( |
| 133 guid, | 133 guid, |
| 134 callbackPass(function(properties) { | 134 callbackPass(function(properties) { |
| 135 assertEq("WiFi", properties.Type); | 135 assertEq("WiFi", properties.Type); |
| 136 assertEq(guid, properties.GUID); | 136 assertEq(guid, properties.GUID); |
| 137 assertEq("wifi_created", properties.WiFi.SSID); | 137 assertEq("wifi_created", properties.WiFi.SSID); |
| 138 assertEq("WEP-PSK", properties.WiFi.Security); | 138 assertEq("WEP-PSK", properties.WiFi.Security); |
| 139 })); | 139 })); |
| 140 })); | 140 })); |
| 141 }, | 141 }, |
| 142 function forgetNetwork() { | |
| 143 var kNumNetworks = 2; | |
| 144 chrome.networkingPrivate.getNetworks( | |
| 145 { "networkType": "WiFi", "visible": true, "configured": true }, | |
| 146 callbackPass(function(networks) { | |
| 147 assertEq(kNumNetworks, networks.length); | |
| 148 chrome.networkingPrivate.forgetNetwork( | |
| 149 "stub_wifi1_guid", callbackPass(function() { | |
| 150 chrome.networkingPrivate.getNetworks( | |
| 151 { "networkType": "WiFi", "visible": true, "configured": true }, | |
| 152 callbackPass(function(networks) { | |
| 153 console.log(JSON.stringify(networks)); | |
|
pneubeck (no reviews)
2015/03/23 14:15:20
debugging left-over?
stevenjb
2015/03/23 16:11:02
Oops. Thanks. Done.
| |
| 154 assertEq(kNumNetworks - 1, networks.length); | |
|
pneubeck (no reviews)
2015/03/23 14:15:20
would be nice to ensure that the right network was
stevenjb
2015/03/23 16:11:02
Done.
| |
| 155 })); | |
| 156 })); | |
| 157 })); | |
| 158 }, | |
| 142 function getNetworks() { | 159 function getNetworks() { |
| 143 // Test 'type' and 'configured'. | 160 // Test 'type' and 'configured'. |
| 144 chrome.networkingPrivate.getNetworks( | 161 chrome.networkingPrivate.getNetworks( |
| 145 { "networkType": "WiFi", "configured": true }, | 162 { "networkType": "WiFi", "configured": true }, |
| 146 callbackPass(function(result) { | 163 callbackPass(function(result) { |
| 147 assertEq([{ | 164 assertEq([{ |
| 148 "Connectable": true, | 165 "Connectable": true, |
| 149 "ConnectionState": "Connected", | 166 "ConnectionState": "Connected", |
| 150 "GUID": "stub_wifi1_guid", | 167 "GUID": "stub_wifi1_guid", |
| 151 "Name": "wifi1", | 168 "Name": "wifi1", |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 611 new privateHelpers.watchForCaptivePortalState( | 628 new privateHelpers.watchForCaptivePortalState( |
| 612 'wifi_guid', 'Online', done); | 629 'wifi_guid', 'Online', done); |
| 613 chrome.test.sendMessage('notifyPortalDetectorObservers'); | 630 chrome.test.sendMessage('notifyPortalDetectorObservers'); |
| 614 }, | 631 }, |
| 615 ]; | 632 ]; |
| 616 | 633 |
| 617 var testToRun = window.location.search.substring(1); | 634 var testToRun = window.location.search.substring(1); |
| 618 chrome.test.runTests(availableTests.filter(function(op) { | 635 chrome.test.runTests(availableTests.filter(function(op) { |
| 619 return op.name == testToRun; | 636 return op.name == testToRun; |
| 620 })); | 637 })); |
| OLD | NEW |