40 lines
1.1 KiB
HTML
40 lines
1.1 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
|
</head>
|
|
<body onload="run()">
|
|
<script type="application/javascript">
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
async function run() {
|
|
try {
|
|
let printerList = Cc["@mozilla.org/gfx/printerlist;1"].getService(
|
|
Ci.nsIPrinterList
|
|
);
|
|
|
|
let printers = await printerList.printers;
|
|
for (let printer of printers) {
|
|
printer.QueryInterface(Ci.nsIPrinter);
|
|
info(`Listing basic attributes for ${printer.name}:`);
|
|
let [supportsDuplex, supportsColor] = await Promise.all([printer.supportsDuplex, printer.supportsColor]);
|
|
info(`* supportsDuplex: ${supportsDuplex}`);
|
|
info(`* supportsColor: ${supportsColor}`);
|
|
is(typeof printer.sortAfterLocal, "boolean",
|
|
"sortAfterLocal is a boolean");
|
|
info(`* sortAfterLocal: ${printer.sortAfterLocal}`);
|
|
}
|
|
|
|
ok(true, "Retrieved printer basic attributes successfully.");
|
|
} catch (e) {
|
|
ok(false, `Error thrown while retrieving printer basic attributes: ${e}.`);
|
|
console.error(e);
|
|
}
|
|
SimpleTest.finish();
|
|
}
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|