summaryrefslogtreecommitdiffstats
path: root/layout/base/tests/chrome/test_get_printer_basic_attributes.html
diff options
context:
space:
mode:
Diffstat (limited to 'layout/base/tests/chrome/test_get_printer_basic_attributes.html')
-rw-r--r--layout/base/tests/chrome/test_get_printer_basic_attributes.html36
1 files changed, 36 insertions, 0 deletions
diff --git a/layout/base/tests/chrome/test_get_printer_basic_attributes.html b/layout/base/tests/chrome/test_get_printer_basic_attributes.html
new file mode 100644
index 0000000000..26a04e09d5
--- /dev/null
+++ b/layout/base/tests/chrome/test_get_printer_basic_attributes.html
@@ -0,0 +1,36 @@
+<!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}`);
+ }
+
+ 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>