blob: 6f30c87d8c9810b3f4f40ae1b75136b443ac5a26 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
let badPrinterName = "Bad";
let otherPrinterName = "Fallback";
async function setupPrinters(helper) {
let badPrinter = helper.addMockPrinter({
name: badPrinterName,
});
let badPrinterInfo = await badPrinter.printerInfo;
badPrinterInfo.defaultSettings.printerName = "";
helper.addMockPrinter(otherPrinterName);
await SpecialPowers.pushPrefEnv({
set: [["print_printer", badPrinterName]],
});
}
add_task(async function testBadPrinterSettings() {
await PrintHelper.withTestPage(async helper => {
await setupPrinters(helper);
await helper.startPrint();
let destinationPicker = helper.get("printer-picker");
// Fallback can be any other printer, the fallback or save to pdf printer.
isnot(
destinationPicker.value,
badPrinterName,
"A fallback printer is selected"
);
await helper.closeDialog();
});
});
|