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

Side by Side Diff: extensions/test/data/api_test/printer_provider/usb_printers/test.js

Issue 1148383002: Add onGetUsbPrinterInfoRequested event to printerProvider API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 6 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 chrome.test.sendMessage('loaded', function(test) {
6 chrome.test.runTests([function printTest() {
7 if (test == 'NO_LISTENER') {
8 chrome.test.sendMessage('ready');
9 chrome.test.succeed();
10 return;
11 }
12
13 chrome.printerProvider.onGetUsbPrinterInfoRequested.addListener(
14 function(device, callback) {
15 chrome.test.assertFalse(!!chrome.printerProviderInternal);
16 chrome.test.assertTrue(!!callback);
17
18 if (test == 'EMPTY_RESPONSE') {
19 callback();
20 } else {
21 callback({
22 'id': 'usbDevice-' + device.device,
23 'name': 'Test Printer',
24 'description': 'This printer is a USB device.',
25 });
26 }
27
28 chrome.test.assertThrows(
29 callback,
30 [],
31 'Event callback must not be called more than once.');
32
33 chrome.test.succeed();
34 });
35
36 chrome.test.sendMessage('ready');
37 }]);
38 });
OLDNEW
« no previous file with comments | « extensions/test/data/api_test/printer_provider/usb_printers/manifest.json ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698