Update broken references to image assets
[chromium-blink-merge.git] / extensions / test / data / api_test / printer_provider / request_printers_second / test.js
blob70521b24519ca21d9ac8aecc5052cf261e40b957
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');
9 chrome.test.succeed();
10 return;
13 chrome.printerProvider.onGetPrintersRequested.addListener(
14 function(callback) {
15 chrome.test.assertFalse(!!chrome.printerProviderInternal);
16 chrome.test.assertTrue(!!callback);
18 if (test == 'IGNORE_CALLBACK') {
19 chrome.test.succeed();
20 return;
23 if (test == 'INVALID_VALUE') {
24 chrome.test.assertThrows(
25 callback,
26 ['XXX'],
27 'Error validating the callback argument: '+
28 'Expected an object, found string.');
29 } else if (test == 'EMPTY') {
30 callback([]);
31 } else {
32 chrome.test.assertEq('OK', test);
33 callback([{
34 id: 'printer1',
35 name: 'Printer 1',
36 description: 'Test printer'
37 }, {
38 id: 'printerNoDesc',
39 name: 'Printer 2'
40 }]);
43 chrome.test.assertThrows(
44 callback,
45 [],
46 'Event callback must not be called more than once.');
48 chrome.test.succeed();
49 });
51 chrome.test.sendMessage('ready');
52 }]);
53 });