browser_headless_screenshot_4.js (769B)
1 "use strict"; 2 3 add_task(async function () { 4 const cwdScreenshotPath = PathUtils.join( 5 Services.dirsvc.get("CurWorkD", Ci.nsIFile).path, 6 "screenshot.png" 7 ); 8 // Test other variations of the "window-size" argument. 9 await testWindowSizePositive(800, 600); 10 await testWindowSizePositive(1234); 11 await testFileCreationNegative( 12 [ 13 "-url", 14 "http://mochi.test:8888/browser/browser/components/shell/test/headless.html", 15 "-screenshot", 16 "-window-size", 17 "hello", 18 ], 19 cwdScreenshotPath 20 ); 21 await testFileCreationNegative( 22 [ 23 "-url", 24 "http://mochi.test:8888/browser/browser/components/shell/test/headless.html", 25 "-screenshot", 26 "-window-size", 27 "800,", 28 ], 29 cwdScreenshotPath 30 ); 31 });