summaryrefslogtreecommitdiffstats
path: root/browser/components/shell/test/browser_headless_screenshot_4.js
blob: 0e3493ef67145f62915fa25c5e0d73fe57fe9ac7 (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
"use strict";

add_task(async function() {
  const cwdScreenshotPath = PathUtils.join(
    Services.dirsvc.get("CurWorkD", Ci.nsIFile).path,
    "screenshot.png"
  );
  // Test other variations of the "window-size" argument.
  await testWindowSizePositive(800, 600);
  await testWindowSizePositive(1234);
  await testFileCreationNegative(
    [
      "-url",
      "http://mochi.test:8888/browser/browser/components/shell/test/headless.html",
      "-screenshot",
      "-window-size",
      "hello",
    ],
    cwdScreenshotPath
  );
  await testFileCreationNegative(
    [
      "-url",
      "http://mochi.test:8888/browser/browser/components/shell/test/headless.html",
      "-screenshot",
      "-window-size",
      "800,",
    ],
    cwdScreenshotPath
  );
});