4 https://bugzilla.mozilla.org/show_bug.cgi?id=1414077
8 <title>Test for Bug
1414077</title>
9 <script src=
"chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"chrome://mochikit/content/tests/SimpleTest/test.css"/>
11 <script type=
"application/javascript">
13 /** Test for Bug
1414077 **/
15 add_task(async function() {
16 await SpecialPowers.pushPrefEnv({
"set": [[
"browser.enable_automatic_image_resizing", true]]});
18 return new Promise(resolve =
> {
19 var testWin = document.querySelector(
"iframe");
20 testWin.src =
"image.png";
21 testWin.onload = function() {
22 var testDoc = testWin.contentDocument;
24 // testDoc should be a image document.
25 ok(testDoc.imageIsOverflowing,
"image is overflowing");
26 ok(testDoc.imageIsResized,
"image is resized to fit visible area by default");
28 // Restore image to original size.
29 testDoc.restoreImage();
30 ok(testDoc.imageIsOverflowing,
"image is overflowing");
31 ok(!testDoc.imageIsResized,
"image is restored to original size");
33 // Resize the image to fit visible area
34 testDoc.shrinkToFit();
35 ok(testDoc.imageIsOverflowing,
"image is overflowing");
36 ok(testDoc.imageIsResized,
"image is resized to fit visible area");
47 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=1414077">Mozilla Bug
1414077</a>
48 <iframe width=
"0" height=
"0"></iframe>