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

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

Issue 1006583003: Add title property to chrome.printerProvider pritn job (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « extensions/common/api/printer_provider.idl ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 // Reads a blob content. 5 // Reads a blob content.
6 // @param {!Blob} blob The blob to read. 6 // @param {!Blob} blob The blob to read.
7 // @param {function(?string)} callback Called with the read blob content. 7 // @param {function(?string)} callback Called with the read blob content.
8 // the content will be null on error. 8 // the content will be null on error.
9 function readBlob(blob, callback) { 9 function readBlob(blob, callback) {
10 var reader = new FileReader(); 10 var reader = new FileReader();
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 case 'INVALID_DATA': 57 case 'INVALID_DATA':
58 wrapPrintCallback(callback, test); 58 wrapPrintCallback(callback, test);
59 break; 59 break;
60 case 'OK': 60 case 'OK':
61 readBlob(job.document, function(content) { 61 readBlob(job.document, function(content) {
62 wrapPrintCallback(callback, !!content ? 'OK' : 'INVALID_DATA'); 62 wrapPrintCallback(callback, !!content ? 'OK' : 'INVALID_DATA');
63 63
64 if (content) 64 if (content)
65 chrome.test.assertEq('bytes', content); 65 chrome.test.assertEq('bytes', content);
66 66
67 chrome.test.assertEq('Print job', job.title);
68
67 chrome.test.succeed(); 69 chrome.test.succeed();
68 }); 70 });
69 71
70 // Test will end asynchronously. 72 // Test will end asynchronously.
71 return; 73 return;
72 default: 74 default:
73 callback('FAILED'); 75 callback('FAILED');
74 chrome.test.fail('Invalid input'); 76 chrome.test.fail('Invalid input');
75 return; 77 return;
76 } 78 }
77 79
78 chrome.test.succeed(); 80 chrome.test.succeed();
79 }); 81 });
80 82
81 chrome.test.sendMessage('ready'); 83 chrome.test.sendMessage('ready');
82 }]); 84 }]);
83 }); 85 });
OLDNEW
« no previous file with comments | « extensions/common/api/printer_provider.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698