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

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

Issue 1059033002: Implement networkingPrivate.getDeviceStates (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/networking_private/chromeos/test.js
diff --git a/chrome/test/data/extensions/api_test/networking_private/chromeos/test.js b/chrome/test/data/extensions/api_test/networking_private/chromeos/test.js
index 9d2726875495760f16aeaa51dccb73b44cf0c9db..0f2a0709f3ad9a77ed749d973e67256958519356 100644
--- a/chrome/test/data/extensions/api_test/networking_private/chromeos/test.js
+++ b/chrome/test/data/extensions/api_test/networking_private/chromeos/test.js
@@ -340,6 +340,17 @@ var availableTests = [
}], result);
}));
},
+ function getDeviceStates() {
+ chrome.networkingPrivate.getDeviceStates(callbackPass(function(result) {
+ assertEq([
+ {Scanning: false, State: 'Enabled', Type: 'WiFi'},
+ {State: 'Uninitialized', Type: 'Cellular'},
+ {State: 'Enabled', Type: 'Ethernet'},
pneubeck (no reviews) 2015/04/09 09:41:21 you documentation of the API states that this shou
stevenjb 2015/04/09 16:20:24 Actually, this is a bug in the fake implementation
+ {State: 'Disabled', Type: 'WiMAX'},
+ ],
+ result);
+ }));
+ },
function requestNetworkScan() {
// Connected or Connecting networks should be listed first, sorted by type.
var expected = ['stub_ethernet_guid',
@@ -616,6 +627,17 @@ var availableTests = [
var network = 'stub_wifi2_guid';
chrome.networkingPrivate.startConnect(network, callbackPass());
},
+ function onDeviceStateListChangedEvent() {
+ console.log('onDeviceStateListChangedEvent');
pneubeck (no reviews) 2015/04/09 09:41:21 nit: remove
stevenjb 2015/04/09 16:20:24 Done.
+ var done = chrome.test.callbackAdded();
+ var listener = function() {
pneubeck (no reviews) 2015/04/09 09:41:21 instead of using callbackAdded, you can wrap the l
stevenjb 2015/04/09 16:20:25 Done.
+ chrome.networkingPrivate.onDeviceStateListChanged.removeListener(
+ listener);
+ done();
pneubeck (no reviews) 2015/04/09 09:41:21 not sure if that makes sense with the stub impleme
stevenjb 2015/04/09 16:20:25 I'd just as soon not test behavior that isn't dire
+ };
+ chrome.networkingPrivate.onDeviceStateListChanged.addListener(listener);
+ chrome.networkingPrivate.disableNetworkType('WiFi');
+ },
function verifyDestination() {
chrome.networkingPrivate.verifyDestination(
verificationProperties,

Powered by Google App Engine
This is Rietveld 408576698