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.
5 chrome
.test
.sendMessage('loaded', function(test
) {
6 chrome
.test
.runTests([function printTest() {
7 if (test
== 'NO_LISTENER') {
8 chrome
.test
.sendMessage('ready');
13 chrome
.printerProvider
.onGetUsbPrinterInfoRequested
.addListener(
14 function(device
, callback
) {
15 chrome
.test
.assertFalse(!!chrome
.printerProviderInternal
);
16 chrome
.test
.assertTrue(!!callback
);
18 if (test
== 'EMPTY_RESPONSE') {
22 'id': 'usbDevice-' + device
.device
,
23 'name': 'Test Printer',
24 'description': 'This printer is a USB device.',
28 chrome
.test
.assertThrows(
31 'Event callback must not be called more than once.');
33 chrome
.test
.succeed();
36 chrome
.test
.sendMessage('ready');