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

Side by Side Diff: chrome/test/data/extensions/api_test/gcd_private/api/remove_device.js

Issue 356613002: Add queryForNewLocalDevices to gcdPrivate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 onload = function() { 5 onload = function() {
6 chrome.test.runTests([ 6 chrome.test.runTests([
7 function addRemoveDevice() { 7 function addRemoveDevice() {
8 var should_be_available = true; 8 var should_be_available = true;
9 chrome.gcdPrivate.onCloudDeviceStateChanged.addListener( 9 chrome.gcdPrivate.onLocalDeviceStateChanged.addListener(
10 function(available, device) { 10 function(available, device) {
11 chrome.test.assertEq(available, should_be_available); 11 chrome.test.assertEq(available, should_be_available);
12 should_be_available = false; 12 should_be_available = false;
13 13
14 chrome.test.assertEq(device.setupType, "mdns"); 14 chrome.test.assertEq(device.setupType, "mdns");
15 chrome.test.assertEq(device.idString, 15 chrome.test.assertEq(device.idString,
16 "mdns:myService._privet._tcp.local"); 16 "mdns:myService._privet._tcp.local");
17 chrome.test.assertEq(device.deviceType, "printer"); 17 chrome.test.assertEq(device.deviceType, "printer");
18 chrome.test.assertEq(device.deviceName, 18 chrome.test.assertEq(device.deviceName,
19 "Sample device"); 19 "Sample device");
20 chrome.test.assertEq(device.deviceDescription, 20 chrome.test.assertEq(device.deviceDescription,
21 "Sample device description"); 21 "Sample device description");
22 22
23 if (!available) { 23 if (!available) {
24 // Only pass after device is removed 24 // Only pass after device is removed
25 chrome.test.notifyPass(); 25 chrome.test.notifyPass();
26 } 26 }
27 }) 27 })
28 }]); 28 }]);
29 }; 29 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698