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

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

Issue 363883002: Add API stubs for GCD device commands. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Thu 07/10/2014 0:13:26.25 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 chrome.gcdPrivate.onDeviceRemoved.addListener(
9 chrome.gcdPrivate.onCloudDeviceStateChanged.addListener( 9 function(deviceId) {
10 function(available, device) { 10 chrome.test.assertEq(deviceId,
11 chrome.test.assertEq(available, should_be_available); 11 "mdns:myService._privet._tcp.local");
12 should_be_available = false; 12 chrome.test.notifyPass();
13 13 })
14 chrome.test.assertEq(device.setupType, "mdns");
15 chrome.test.assertEq(device.idString,
16 "mdns:myService._privet._tcp.local");
17 chrome.test.assertEq(device.deviceType, "printer");
18 chrome.test.assertEq(device.deviceName,
19 "Sample device");
20 chrome.test.assertEq(device.deviceDescription,
21 "Sample device description");
22
23 if (!available) {
24 // Only pass after device is removed
25 chrome.test.notifyPass();
26 }
27 })
28 }]); 14 }]);
29 }; 15 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698