From 2aa4a82499d4becd2284cdb482213d541b8804dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 16:29:10 +0200 Subject: Adding upstream version 86.0.1. Signed-off-by: Daniel Baumann --- image/test/mochitest/.eslintrc.js | 5 + image/test/mochitest/12M-pixels-1.png | Bin 0 -> 22467 bytes image/test/mochitest/12M-pixels-2.png | Bin 0 -> 22467 bytes image/test/mochitest/6M-pixels.png | Bin 0 -> 10147 bytes image/test/mochitest/INT32_MIN.bmp | Bin 0 -> 60 bytes image/test/mochitest/animated-gif-finalframe.gif | Bin 0 -> 72 bytes image/test/mochitest/animated-gif.gif | Bin 0 -> 146 bytes image/test/mochitest/animated-gif2.gif | Bin 0 -> 165 bytes .../mochitest/animated-gif_trailing-garbage.gif | Bin 0 -> 4030 bytes image/test/mochitest/animated1.gif | Bin 0 -> 4558 bytes image/test/mochitest/animated2.gif | Bin 0 -> 4558 bytes image/test/mochitest/animation.svg | 5 + image/test/mochitest/animationPolling.js | 469 +++++++++++++++++++++ image/test/mochitest/bad.jpg | Bin 0 -> 2477 bytes image/test/mochitest/big.png | Bin 0 -> 129497 bytes image/test/mochitest/blue.gif | Bin 0 -> 45 bytes image/test/mochitest/blue.png | Bin 0 -> 2745 bytes image/test/mochitest/bug1132427.gif | Bin 0 -> 634 bytes image/test/mochitest/bug1132427.html | 6 + image/test/mochitest/bug1180105-waiter.sjs | 24 ++ image/test/mochitest/bug1180105.sjs | 63 +++ image/test/mochitest/bug1217571-iframe.html | 17 + image/test/mochitest/bug1217571.jpg | Bin 0 -> 2679 bytes image/test/mochitest/bug1319025-ref.png | Bin 0 -> 347 bytes image/test/mochitest/bug1319025.png | Bin 0 -> 422 bytes image/test/mochitest/bug399925.gif | Bin 0 -> 1645 bytes image/test/mochitest/bug415761.ico | Bin 0 -> 766 bytes image/test/mochitest/bug468160.sjs | 6 + image/test/mochitest/bug478398_ONLY.png | Bin 0 -> 14139 bytes image/test/mochitest/bug490949-iframe.html | 7 + image/test/mochitest/bug490949.sjs | 33 ++ image/test/mochitest/bug496292-1.sjs | 32 ++ image/test/mochitest/bug496292-2.sjs | 32 ++ image/test/mochitest/bug496292-iframe-1.html | 7 + image/test/mochitest/bug496292-iframe-2.html | 7 + image/test/mochitest/bug496292-iframe-ref.html | 7 + image/test/mochitest/bug497665-iframe.html | 8 + image/test/mochitest/bug497665.sjs | 34 ++ image/test/mochitest/bug552605.sjs | 13 + image/test/mochitest/bug657191.sjs | 27 ++ image/test/mochitest/bug671906-iframe.html | 7 + image/test/mochitest/bug671906.sjs | 36 ++ image/test/mochitest/bug733553-informant.sjs | 15 + image/test/mochitest/bug733553.sjs | 104 +++++ image/test/mochitest/bug767779.sjs | 56 +++ image/test/mochitest/bug89419-iframe.html | 7 + image/test/mochitest/bug89419.sjs | 13 + image/test/mochitest/bug900200-ref.png | Bin 0 -> 660 bytes image/test/mochitest/bug900200.png | Bin 0 -> 840 bytes image/test/mochitest/child.html | 22 + image/test/mochitest/chrome.ini | 7 + image/test/mochitest/clear.gif | Bin 0 -> 321 bytes image/test/mochitest/clear.png | Bin 0 -> 622 bytes image/test/mochitest/clear.webp | Bin 0 -> 202 bytes image/test/mochitest/clear2-results.gif | Bin 0 -> 177 bytes image/test/mochitest/clear2.gif | Bin 0 -> 219 bytes image/test/mochitest/clear2.webp | Bin 0 -> 228 bytes image/test/mochitest/damon.jpg | Bin 0 -> 2679 bytes image/test/mochitest/error-early.png | 1 + image/test/mochitest/filter-final.svg | 9 + image/test/mochitest/filter.svg | 9 + image/test/mochitest/finite-apng.png | Bin 0 -> 5834 bytes image/test/mochitest/first-frame-padding.gif | Bin 0 -> 49 bytes image/test/mochitest/green-background.html | 29 ++ image/test/mochitest/green.png | Bin 0 -> 255 bytes image/test/mochitest/grey.png | Bin 0 -> 256 bytes image/test/mochitest/ico-bmp-opaque.ico | Bin 0 -> 1094 bytes image/test/mochitest/ico-bmp-transparent.ico | Bin 0 -> 4286 bytes image/test/mochitest/iframe.html | 5 + image/test/mochitest/imgutils.js | 137 ++++++ image/test/mochitest/infinite-apng.png | Bin 0 -> 1169 bytes image/test/mochitest/infinite.webp | Bin 0 -> 3742 bytes image/test/mochitest/invalid.jpg | 1 + image/test/mochitest/keep.gif | Bin 0 -> 321 bytes image/test/mochitest/keep.png | Bin 0 -> 622 bytes image/test/mochitest/keep.webp | Bin 0 -> 152 bytes image/test/mochitest/lime-anim-100x100-2.svg | 6 + image/test/mochitest/lime-anim-100x100.svg | 7 + image/test/mochitest/lime-css-anim-100x100.svg | 19 + image/test/mochitest/lime100x100.svg | 4 + image/test/mochitest/mochitest.ini | 162 +++++++ image/test/mochitest/mq_dynamic_svg_ref.html | 38 ++ image/test/mochitest/mq_dynamic_svg_test.html | 61 +++ image/test/mochitest/opaque.bmp | Bin 0 -> 1086 bytes image/test/mochitest/over.png | Bin 0 -> 525 bytes image/test/mochitest/purple.gif | Bin 0 -> 86 bytes image/test/mochitest/rainbow.gif | Bin 0 -> 1572 bytes image/test/mochitest/red.gif | Bin 0 -> 43 bytes image/test/mochitest/red.png | Bin 0 -> 82 bytes image/test/mochitest/ref-iframe.html | 6 + image/test/mochitest/restore-previous.gif | Bin 0 -> 457 bytes image/test/mochitest/restore-previous.png | Bin 0 -> 622 bytes image/test/mochitest/rillybad.jpg | Bin 0 -> 11142 bytes image/test/mochitest/schrep.png | Bin 0 -> 38767 bytes image/test/mochitest/shaver.png | Bin 0 -> 52045 bytes image/test/mochitest/short_header.gif | Bin 0 -> 1488 bytes image/test/mochitest/source.png | Bin 0 -> 525 bytes image/test/mochitest/test_animSVGImage.html | 124 ++++++ image/test/mochitest/test_animSVGImage2.html | 124 ++++++ image/test/mochitest/test_animated_css_image.html | 165 ++++++++ image/test/mochitest/test_animated_gif.html | 50 +++ image/test/mochitest/test_animation.html | 45 ++ image/test/mochitest/test_animation2.html | 49 +++ image/test/mochitest/test_animation_operators.html | 167 ++++++++ .../test/mochitest/test_background_image_anim.html | 44 ++ image/test/mochitest/test_bug1132427.html | 94 +++++ image/test/mochitest/test_bug1180105.html | 46 ++ image/test/mochitest/test_bug1217571.html | 43 ++ image/test/mochitest/test_bug1325080.html | 37 ++ image/test/mochitest/test_bug399925.html | 102 +++++ image/test/mochitest/test_bug415761.html | 118 ++++++ image/test/mochitest/test_bug435296.html | 85 ++++ image/test/mochitest/test_bug466586.html | 58 +++ image/test/mochitest/test_bug468160.html | 29 ++ image/test/mochitest/test_bug478398.html | 87 ++++ image/test/mochitest/test_bug490949.html | 112 +++++ image/test/mochitest/test_bug496292.html | 130 ++++++ image/test/mochitest/test_bug497665.html | 92 ++++ image/test/mochitest/test_bug552605-1.html | 56 +++ image/test/mochitest/test_bug552605-2.html | 53 +++ image/test/mochitest/test_bug553982.html | 39 ++ image/test/mochitest/test_bug601470.html | 45 ++ image/test/mochitest/test_bug614392.html | 42 ++ image/test/mochitest/test_bug657191.html | 34 ++ image/test/mochitest/test_bug671906.html | 71 ++++ image/test/mochitest/test_bug733553.html | 92 ++++ image/test/mochitest/test_bug767779.html | 44 ++ image/test/mochitest/test_bug865919.html | 53 +++ image/test/mochitest/test_bug89419-1.html | 68 +++ image/test/mochitest/test_bug89419-2.html | 70 +++ image/test/mochitest/test_bullet_animation.html | 56 +++ .../mochitest/test_canvas_frame_animation.html | 24 ++ image/test/mochitest/test_changeOfSource.html | 62 +++ image/test/mochitest/test_changeOfSource2.html | 47 +++ .../test/mochitest/test_discardAnimatedImage.html | 215 ++++++++++ .../test_discardFinishedAnimatedImage.html | 144 +++++++ .../mochitest/test_discardFramesAnimatedImage.html | 268 ++++++++++++ image/test/mochitest/test_drawDiscardedImage.html | 85 ++++ image/test/mochitest/test_error_events.html | 67 +++ image/test/mochitest/test_has_transparency.html | 169 ++++++++ .../mochitest/test_image_crossorigin_data_url.html | 28 ++ image/test/mochitest/test_mq_dynamic_svg.html | 36 ++ image/test/mochitest/test_net_failedtoprocess.html | 52 +++ image/test/mochitest/test_removal_ondecode.html | 160 +++++++ image/test/mochitest/test_removal_onload.html | 142 +++++++ image/test/mochitest/test_short_gif_header.html | 35 ++ image/test/mochitest/test_staticClone.html | 41 ++ image/test/mochitest/test_svg_animatedGIF.html | 53 +++ .../test/mochitest/test_svg_filter_animation.html | 42 ++ .../mochitest/test_synchronized_animation.html | 128 ++++++ image/test/mochitest/test_undisplayed_iframe.html | 47 +++ image/test/mochitest/test_webcam.html | 68 +++ image/test/mochitest/test_xultree_animation.xhtml | 67 +++ image/test/mochitest/transparent.gif | Bin 0 -> 355 bytes image/test/mochitest/transparent.png | Bin 0 -> 419 bytes image/test/mochitest/webcam-simulacrum.sjs | 51 +++ 156 files changed, 6118 insertions(+) create mode 100644 image/test/mochitest/.eslintrc.js create mode 100644 image/test/mochitest/12M-pixels-1.png create mode 100644 image/test/mochitest/12M-pixels-2.png create mode 100644 image/test/mochitest/6M-pixels.png create mode 100644 image/test/mochitest/INT32_MIN.bmp create mode 100644 image/test/mochitest/animated-gif-finalframe.gif create mode 100644 image/test/mochitest/animated-gif.gif create mode 100644 image/test/mochitest/animated-gif2.gif create mode 100644 image/test/mochitest/animated-gif_trailing-garbage.gif create mode 100644 image/test/mochitest/animated1.gif create mode 100644 image/test/mochitest/animated2.gif create mode 100644 image/test/mochitest/animation.svg create mode 100644 image/test/mochitest/animationPolling.js create mode 100644 image/test/mochitest/bad.jpg create mode 100644 image/test/mochitest/big.png create mode 100644 image/test/mochitest/blue.gif create mode 100644 image/test/mochitest/blue.png create mode 100644 image/test/mochitest/bug1132427.gif create mode 100644 image/test/mochitest/bug1132427.html create mode 100644 image/test/mochitest/bug1180105-waiter.sjs create mode 100644 image/test/mochitest/bug1180105.sjs create mode 100644 image/test/mochitest/bug1217571-iframe.html create mode 100644 image/test/mochitest/bug1217571.jpg create mode 100644 image/test/mochitest/bug1319025-ref.png create mode 100644 image/test/mochitest/bug1319025.png create mode 100644 image/test/mochitest/bug399925.gif create mode 100644 image/test/mochitest/bug415761.ico create mode 100644 image/test/mochitest/bug468160.sjs create mode 100644 image/test/mochitest/bug478398_ONLY.png create mode 100644 image/test/mochitest/bug490949-iframe.html create mode 100644 image/test/mochitest/bug490949.sjs create mode 100644 image/test/mochitest/bug496292-1.sjs create mode 100644 image/test/mochitest/bug496292-2.sjs create mode 100644 image/test/mochitest/bug496292-iframe-1.html create mode 100644 image/test/mochitest/bug496292-iframe-2.html create mode 100644 image/test/mochitest/bug496292-iframe-ref.html create mode 100644 image/test/mochitest/bug497665-iframe.html create mode 100644 image/test/mochitest/bug497665.sjs create mode 100644 image/test/mochitest/bug552605.sjs create mode 100644 image/test/mochitest/bug657191.sjs create mode 100644 image/test/mochitest/bug671906-iframe.html create mode 100644 image/test/mochitest/bug671906.sjs create mode 100644 image/test/mochitest/bug733553-informant.sjs create mode 100644 image/test/mochitest/bug733553.sjs create mode 100644 image/test/mochitest/bug767779.sjs create mode 100644 image/test/mochitest/bug89419-iframe.html create mode 100644 image/test/mochitest/bug89419.sjs create mode 100644 image/test/mochitest/bug900200-ref.png create mode 100644 image/test/mochitest/bug900200.png create mode 100644 image/test/mochitest/child.html create mode 100644 image/test/mochitest/chrome.ini create mode 100644 image/test/mochitest/clear.gif create mode 100644 image/test/mochitest/clear.png create mode 100644 image/test/mochitest/clear.webp create mode 100644 image/test/mochitest/clear2-results.gif create mode 100644 image/test/mochitest/clear2.gif create mode 100644 image/test/mochitest/clear2.webp create mode 100644 image/test/mochitest/damon.jpg create mode 100644 image/test/mochitest/error-early.png create mode 100644 image/test/mochitest/filter-final.svg create mode 100644 image/test/mochitest/filter.svg create mode 100644 image/test/mochitest/finite-apng.png create mode 100644 image/test/mochitest/first-frame-padding.gif create mode 100644 image/test/mochitest/green-background.html create mode 100644 image/test/mochitest/green.png create mode 100644 image/test/mochitest/grey.png create mode 100644 image/test/mochitest/ico-bmp-opaque.ico create mode 100644 image/test/mochitest/ico-bmp-transparent.ico create mode 100644 image/test/mochitest/iframe.html create mode 100644 image/test/mochitest/imgutils.js create mode 100644 image/test/mochitest/infinite-apng.png create mode 100644 image/test/mochitest/infinite.webp create mode 100644 image/test/mochitest/invalid.jpg create mode 100644 image/test/mochitest/keep.gif create mode 100644 image/test/mochitest/keep.png create mode 100644 image/test/mochitest/keep.webp create mode 100644 image/test/mochitest/lime-anim-100x100-2.svg create mode 100644 image/test/mochitest/lime-anim-100x100.svg create mode 100644 image/test/mochitest/lime-css-anim-100x100.svg create mode 100644 image/test/mochitest/lime100x100.svg create mode 100644 image/test/mochitest/mochitest.ini create mode 100644 image/test/mochitest/mq_dynamic_svg_ref.html create mode 100644 image/test/mochitest/mq_dynamic_svg_test.html create mode 100644 image/test/mochitest/opaque.bmp create mode 100644 image/test/mochitest/over.png create mode 100644 image/test/mochitest/purple.gif create mode 100644 image/test/mochitest/rainbow.gif create mode 100644 image/test/mochitest/red.gif create mode 100644 image/test/mochitest/red.png create mode 100644 image/test/mochitest/ref-iframe.html create mode 100644 image/test/mochitest/restore-previous.gif create mode 100644 image/test/mochitest/restore-previous.png create mode 100644 image/test/mochitest/rillybad.jpg create mode 100644 image/test/mochitest/schrep.png create mode 100644 image/test/mochitest/shaver.png create mode 100644 image/test/mochitest/short_header.gif create mode 100644 image/test/mochitest/source.png create mode 100644 image/test/mochitest/test_animSVGImage.html create mode 100644 image/test/mochitest/test_animSVGImage2.html create mode 100644 image/test/mochitest/test_animated_css_image.html create mode 100644 image/test/mochitest/test_animated_gif.html create mode 100644 image/test/mochitest/test_animation.html create mode 100644 image/test/mochitest/test_animation2.html create mode 100644 image/test/mochitest/test_animation_operators.html create mode 100644 image/test/mochitest/test_background_image_anim.html create mode 100644 image/test/mochitest/test_bug1132427.html create mode 100644 image/test/mochitest/test_bug1180105.html create mode 100644 image/test/mochitest/test_bug1217571.html create mode 100644 image/test/mochitest/test_bug1325080.html create mode 100644 image/test/mochitest/test_bug399925.html create mode 100644 image/test/mochitest/test_bug415761.html create mode 100644 image/test/mochitest/test_bug435296.html create mode 100644 image/test/mochitest/test_bug466586.html create mode 100644 image/test/mochitest/test_bug468160.html create mode 100644 image/test/mochitest/test_bug478398.html create mode 100644 image/test/mochitest/test_bug490949.html create mode 100644 image/test/mochitest/test_bug496292.html create mode 100644 image/test/mochitest/test_bug497665.html create mode 100644 image/test/mochitest/test_bug552605-1.html create mode 100644 image/test/mochitest/test_bug552605-2.html create mode 100644 image/test/mochitest/test_bug553982.html create mode 100644 image/test/mochitest/test_bug601470.html create mode 100644 image/test/mochitest/test_bug614392.html create mode 100644 image/test/mochitest/test_bug657191.html create mode 100644 image/test/mochitest/test_bug671906.html create mode 100644 image/test/mochitest/test_bug733553.html create mode 100644 image/test/mochitest/test_bug767779.html create mode 100644 image/test/mochitest/test_bug865919.html create mode 100644 image/test/mochitest/test_bug89419-1.html create mode 100644 image/test/mochitest/test_bug89419-2.html create mode 100644 image/test/mochitest/test_bullet_animation.html create mode 100644 image/test/mochitest/test_canvas_frame_animation.html create mode 100644 image/test/mochitest/test_changeOfSource.html create mode 100644 image/test/mochitest/test_changeOfSource2.html create mode 100644 image/test/mochitest/test_discardAnimatedImage.html create mode 100644 image/test/mochitest/test_discardFinishedAnimatedImage.html create mode 100644 image/test/mochitest/test_discardFramesAnimatedImage.html create mode 100644 image/test/mochitest/test_drawDiscardedImage.html create mode 100644 image/test/mochitest/test_error_events.html create mode 100644 image/test/mochitest/test_has_transparency.html create mode 100644 image/test/mochitest/test_image_crossorigin_data_url.html create mode 100644 image/test/mochitest/test_mq_dynamic_svg.html create mode 100644 image/test/mochitest/test_net_failedtoprocess.html create mode 100644 image/test/mochitest/test_removal_ondecode.html create mode 100644 image/test/mochitest/test_removal_onload.html create mode 100644 image/test/mochitest/test_short_gif_header.html create mode 100644 image/test/mochitest/test_staticClone.html create mode 100644 image/test/mochitest/test_svg_animatedGIF.html create mode 100644 image/test/mochitest/test_svg_filter_animation.html create mode 100644 image/test/mochitest/test_synchronized_animation.html create mode 100644 image/test/mochitest/test_undisplayed_iframe.html create mode 100644 image/test/mochitest/test_webcam.html create mode 100644 image/test/mochitest/test_xultree_animation.xhtml create mode 100644 image/test/mochitest/transparent.gif create mode 100644 image/test/mochitest/transparent.png create mode 100644 image/test/mochitest/webcam-simulacrum.sjs (limited to 'image/test/mochitest') diff --git a/image/test/mochitest/.eslintrc.js b/image/test/mochitest/.eslintrc.js new file mode 100644 index 0000000000..721e0938af --- /dev/null +++ b/image/test/mochitest/.eslintrc.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = { + extends: ["plugin:mozilla/mochitest-test", "plugin:mozilla/chrome-test"], +}; diff --git a/image/test/mochitest/12M-pixels-1.png b/image/test/mochitest/12M-pixels-1.png new file mode 100644 index 0000000000..f802dd5396 Binary files /dev/null and b/image/test/mochitest/12M-pixels-1.png differ diff --git a/image/test/mochitest/12M-pixels-2.png b/image/test/mochitest/12M-pixels-2.png new file mode 100644 index 0000000000..a6d430442e Binary files /dev/null and b/image/test/mochitest/12M-pixels-2.png differ diff --git a/image/test/mochitest/6M-pixels.png b/image/test/mochitest/6M-pixels.png new file mode 100644 index 0000000000..c813d8b569 Binary files /dev/null and b/image/test/mochitest/6M-pixels.png differ diff --git a/image/test/mochitest/INT32_MIN.bmp b/image/test/mochitest/INT32_MIN.bmp new file mode 100644 index 0000000000..d9a0016107 Binary files /dev/null and b/image/test/mochitest/INT32_MIN.bmp differ diff --git a/image/test/mochitest/animated-gif-finalframe.gif b/image/test/mochitest/animated-gif-finalframe.gif new file mode 100644 index 0000000000..4e80d31a72 Binary files /dev/null and b/image/test/mochitest/animated-gif-finalframe.gif differ diff --git a/image/test/mochitest/animated-gif.gif b/image/test/mochitest/animated-gif.gif new file mode 100644 index 0000000000..001cbfb87a Binary files /dev/null and b/image/test/mochitest/animated-gif.gif differ diff --git a/image/test/mochitest/animated-gif2.gif b/image/test/mochitest/animated-gif2.gif new file mode 100644 index 0000000000..c66cc4b734 Binary files /dev/null and b/image/test/mochitest/animated-gif2.gif differ diff --git a/image/test/mochitest/animated-gif_trailing-garbage.gif b/image/test/mochitest/animated-gif_trailing-garbage.gif new file mode 100644 index 0000000000..02f4de2e31 Binary files /dev/null and b/image/test/mochitest/animated-gif_trailing-garbage.gif differ diff --git a/image/test/mochitest/animated1.gif b/image/test/mochitest/animated1.gif new file mode 100644 index 0000000000..2f9d8a512b Binary files /dev/null and b/image/test/mochitest/animated1.gif differ diff --git a/image/test/mochitest/animated2.gif b/image/test/mochitest/animated2.gif new file mode 100644 index 0000000000..2f9d8a512b Binary files /dev/null and b/image/test/mochitest/animated2.gif differ diff --git a/image/test/mochitest/animation.svg b/image/test/mochitest/animation.svg new file mode 100644 index 0000000000..2141d86791 --- /dev/null +++ b/image/test/mochitest/animation.svg @@ -0,0 +1,5 @@ + + + + diff --git a/image/test/mochitest/animationPolling.js b/image/test/mochitest/animationPolling.js new file mode 100644 index 0000000000..272b517f24 --- /dev/null +++ b/image/test/mochitest/animationPolling.js @@ -0,0 +1,469 @@ +// This file expects imgutils.js to be loaded as well. +/* import-globals-from imgutils.js */ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +var currentTest; +var gIsRefImageLoaded = false; +const gShouldOutputDebugInfo = false; + +function pollForSuccess() { + if (!currentTest.isTestFinished) { + if ( + !currentTest.reusingReferenceImage || + (currentTest.reusingReferenceImage && gIsRefImageLoaded) + ) { + currentTest.checkImage(); + } + + setTimeout(pollForSuccess, currentTest.pollFreq); + } +} + +function reuseImageCallback() { + gIsRefImageLoaded = true; +} + +function failTest() { + if (currentTest.isTestFinished || currentTest.closeFunc) { + return; + } + + ok( + false, + "timing out after " + + currentTest.timeout + + "ms. " + + "Animated image still doesn't look correct, after poll #" + + currentTest.pollCounter + ); + currentTest.wereFailures = true; + + if (currentTest.currentSnapshotDataURI) { + currentTest.outputDebugInfo( + "Snapshot #" + currentTest.pollCounter, + "snapNum" + currentTest.pollCounter, + currentTest.currentSnapshotDataURI + ); + } + + currentTest.enableDisplay( + document.getElementById(currentTest.debugElementId) + ); + + currentTest.cleanUpAndFinish(); +} + +/** + * Create a new AnimationTest object. + * + * @param pollFreq The amount of time (in ms) to wait between consecutive + * snapshots if the reference image and the test image don't match. + * @param timeout The total amount of time (in ms) to wait before declaring the + * test as failed. + * @param referenceElementId The id attribute of the reference image element, or + * the source of the image to change to, once the reference snapshot has + * been successfully taken. This latter option could be used if you don't + * want the image to become invisible at any time during the test. + * @param imageElementId The id attribute of the test image element. + * @param debugElementId The id attribute of the div where links should be + * appended if the test fails. + * @param cleanId The id attribute of the div or element to use as the 'clean' + * test. This element is only enabled when we are testing to verify that + * the reference image has been loaded. It can be undefined. + * @param srcAttr The location of the source of the image, for preloading. This + * is usually not required, but it useful for preloading reference + * images. + * @param xulTest A boolean value indicating whether or not this is a XUL test + * (uses hidden=true/false rather than display: none to hide/show + * elements). + * @param closeFunc A function that should be called when this test is finished. + * If null, then cleanUpAndFinish() will be called. This can be used to + * chain tests together, so they are all finished exactly once. + * @returns {AnimationTest} + */ +function AnimationTest( + pollFreq, + timeout, + referenceElementId, + imageElementId, + debugElementId, + cleanId, + srcAttr, + xulTest, + closeFunc +) { + // We want to test the cold loading behavior, so clear cache in case an + // earlier test got our image in there already. + clearAllImageCaches(); + + this.wereFailures = false; + this.pollFreq = pollFreq; + this.timeout = timeout; + this.imageElementId = imageElementId; + this.referenceElementId = referenceElementId; + + if (!document.getElementById(referenceElementId)) { + // In this case, we're assuming the user passed in a string that + // indicates the source of the image they want to change to, + // after the reference image has been taken. + this.reusingImageAsReference = true; + } + + this.srcAttr = srcAttr; + this.debugElementId = debugElementId; + this.referenceSnapshot = ""; // value will be set in takeReferenceSnapshot() + this.pollCounter = 0; + this.isTestFinished = false; + this.numRefsTaken = 0; + this.blankWaitTime = 0; + + this.cleanId = cleanId ? cleanId : ""; + this.xulTest = xulTest ? xulTest : ""; + this.closeFunc = closeFunc ? closeFunc : ""; +} + +AnimationTest.prototype.preloadImage = function() { + if (this.srcAttr) { + this.myImage = new Image(); + this.myImage.onload = function() { + currentTest.continueTest(); + }; + this.myImage.src = this.srcAttr; + } else { + this.continueTest(); + } +}; + +AnimationTest.prototype.outputDebugInfo = function(message, id, dataUri) { + if (!gShouldOutputDebugInfo) { + return; + } + var debugElement = document.getElementById(this.debugElementId); + var newDataUriElement = document.createElement("a"); + newDataUriElement.setAttribute("id", id); + newDataUriElement.setAttribute("href", dataUri); + newDataUriElement.appendChild(document.createTextNode(message)); + debugElement.appendChild(newDataUriElement); + var brElement = document.createElement("br"); + debugElement.appendChild(brElement); + todo(false, "Debug (" + id + "): " + message + " " + dataUri); +}; + +AnimationTest.prototype.isFinished = function() { + return this.isTestFinished; +}; + +AnimationTest.prototype.takeCleanSnapshot = function() { + var cleanElement; + if (this.cleanId) { + cleanElement = document.getElementById(this.cleanId); + } + + // Enable clean page comparison element + if (cleanElement) { + this.enableDisplay(cleanElement); + } + + // Take a snapshot of the initial (clean) page + this.cleanSnapshot = snapshotWindow(window, false); + + // Disable the clean page comparison element + if (cleanElement) { + this.disableDisplay(cleanElement); + } + + var dataString1 = "Clean Snapshot"; + this.outputDebugInfo( + dataString1, + "cleanSnap", + this.cleanSnapshot.toDataURL() + ); +}; + +AnimationTest.prototype.takeBlankSnapshot = function() { + // Take a snapshot of the initial (essentially blank) page + this.blankSnapshot = snapshotWindow(window, false); + + var dataString1 = "Initial Blank Snapshot"; + this.outputDebugInfo( + dataString1, + "blank1Snap", + this.blankSnapshot.toDataURL() + ); +}; + +/** + * Begin the AnimationTest. This will utilize the information provided in the + * constructor to invoke a mochitest on animated images. It will automatically + * fail if allowed to run past the timeout. This will attempt to preload an + * image, if applicable, and then asynchronously call continueTest(), or if not + * applicable, synchronously trigger a call to continueTest(). + */ +AnimationTest.prototype.beginTest = function() { + SimpleTest.waitForExplicitFinish(); + SimpleTest.requestFlakyTimeout("untriaged"); + + currentTest = this; + this.preloadImage(); +}; + +/** + * This is the second part of the test. It is triggered (eventually) from + * beginTest() either synchronously or asynchronously, as an image load + * callback. + */ +AnimationTest.prototype.continueTest = async function() { + // In case something goes wrong, fail earlier than mochitest timeout, + // and with more information. + setTimeout(failTest, this.timeout); + + if (!this.reusingImageAsReference) { + this.disableDisplay(document.getElementById(this.imageElementId)); + } + + let tookReference = new Promise(resolve => { + this.takeReferenceSnapshot(resolve); + }); + + tookReference.then(() => { + this.setupPolledImage(); + SimpleTest.executeSoon(pollForSuccess); + }); +}; + +AnimationTest.prototype.setupPolledImage = function() { + // Make sure the image is visible + if (!this.reusingImageAsReference) { + this.enableDisplay(document.getElementById(this.imageElementId)); + var currentSnapshot = snapshotWindow(window, false); + var result = compareSnapshots( + currentSnapshot, + this.referenceSnapshot, + true + ); + + this.currentSnapshotDataURI = currentSnapshot.toDataURL(); + + if (result[0]) { + // SUCCESS! + ok(true, "Animated image looks correct, at poll #" + this.pollCounter); + + this.outputDebugInfo( + "Animated image", + "animImage", + this.currentSnapshotDataURI + ); + + this.outputDebugInfo( + "Reference image", + "refImage", + this.referenceSnapshot.toDataURL() + ); + + this.cleanUpAndFinish(); + } + } else if (!gIsRefImageLoaded) { + this.myImage = new Image(); + this.myImage.onload = reuseImageCallback; + document + .getElementById(this.imageElementId) + .setAttribute("src", this.referenceElementId); + } +}; + +AnimationTest.prototype.checkImage = function() { + if (this.isTestFinished) { + return; + } + + this.pollCounter++; + + // We need this for some tests, because we need to force the + // test image to be visible. + if (!this.reusingImageAsReference) { + this.enableDisplay(document.getElementById(this.imageElementId)); + } + + var currentSnapshot = snapshotWindow(window, false); + var result = compareSnapshots(currentSnapshot, this.referenceSnapshot, true); + + this.currentSnapshotDataURI = currentSnapshot.toDataURL(); + + if (result[0]) { + // SUCCESS! + ok(true, "Animated image looks correct, at poll #" + this.pollCounter); + + this.outputDebugInfo("Animated image", "animImage", result[1]); + + this.outputDebugInfo("Reference image", "refImage", result[2]); + + this.cleanUpAndFinish(); + } +}; + +AnimationTest.prototype.takeReferenceSnapshot = function(resolve) { + this.numRefsTaken++; + + // Test to make sure the reference image doesn't match a clean snapshot + if (!this.cleanSnapshot) { + this.takeCleanSnapshot(); + } + + // Used later to verify that the reference div disappeared + if (!this.blankSnapshot) { + this.takeBlankSnapshot(); + } + + if (this.reusingImageAsReference) { + // Show reference elem (which is actually our image), & take a snapshot + var referenceElem = document.getElementById(this.imageElementId); + this.enableDisplay(referenceElem); + + this.referenceSnapshot = snapshotWindow(window, false); + + let snapResult = compareSnapshots( + this.cleanSnapshot, + this.referenceSnapshot, + false + ); + if (!snapResult[0]) { + if (this.blankWaitTime > 2000) { + // if it took longer than two seconds to load the image, we probably + // have a problem. + this.wereFailures = true; + ok( + snapResult[0], + "Reference snapshot shouldn't match clean (non-image) snapshot" + ); + } else { + this.blankWaitTime += currentTest.pollFreq; + // let's wait a bit and see if it clears up + setTimeout( + () => this.takeReferenceSnapshot(resolve), + currentTest.pollFreq + ); + return; + } + } + + ok( + snapResult[0], + "Reference snapshot shouldn't match clean (non-image) snapshot" + ); + + let dataString = "Reference Snapshot #" + this.numRefsTaken; + this.outputDebugInfo( + dataString, + "refSnapId", + this.referenceSnapshot.toDataURL() + ); + } else { + // Make sure the animation section is hidden + this.disableDisplay(document.getElementById(this.imageElementId)); + + // Show reference div, & take a snapshot + var referenceDiv = document.getElementById(this.referenceElementId); + this.enableDisplay(referenceDiv); + + this.referenceSnapshot = snapshotWindow(window, false); + let snapResult = compareSnapshots( + this.cleanSnapshot, + this.referenceSnapshot, + false + ); + if (!snapResult[0]) { + if (this.blankWaitTime > 2000) { + // if it took longer than two seconds to load the image, we probably + // have a problem. + this.wereFailures = true; + ok( + snapResult[0], + "Reference snapshot shouldn't match clean (non-image) snapshot" + ); + } else { + this.blankWaitTime += 20; + // let's wait a bit and see if it clears up + setTimeout(() => this.takeReferenceSnapshot(resolve), 20); + return; + } + } + + ok( + snapResult[0], + "Reference snapshot shouldn't match clean (non-image) snapshot" + ); + + let dataString = "Reference Snapshot #" + this.numRefsTaken; + this.outputDebugInfo( + dataString, + "refSnapId", + this.referenceSnapshot.toDataURL() + ); + + // Re-hide reference div, and take another snapshot to be sure it's gone + this.disableDisplay(referenceDiv); + this.testBlankCameBack(); + } + resolve(); +}; + +AnimationTest.prototype.enableDisplay = function(element) { + if (!element) { + return; + } + + if (!this.xulTest) { + element.style.display = ""; + } else { + element.setAttribute("hidden", "false"); + } +}; + +AnimationTest.prototype.disableDisplay = function(element) { + if (!element) { + return; + } + + if (!this.xulTest) { + element.style.display = "none"; + } else { + element.setAttribute("hidden", "true"); + } +}; + +AnimationTest.prototype.testBlankCameBack = function() { + var blankSnapshot2 = snapshotWindow(window, false); + var result = compareSnapshots(this.blankSnapshot, blankSnapshot2, true); + ok( + result[0], + "Reference image should disappear when it becomes display:none" + ); + + if (!result[0]) { + this.wereFailures = true; + var dataString = "Second Blank Snapshot"; + this.outputDebugInfo(dataString, "blank2SnapId", result[2]); + } +}; + +AnimationTest.prototype.cleanUpAndFinish = function() { + // On the off chance that failTest and checkImage are triggered + // back-to-back, use a flag to prevent multiple calls to SimpleTest.finish. + if (this.isTestFinished) { + return; + } + + this.isTestFinished = true; + + // Call our closing function, if one exists + if (this.closeFunc) { + this.closeFunc(); + return; + } + + if (this.wereFailures) { + document.getElementById(this.debugElementId).style.display = "block"; + } + + SimpleTest.finish(); + document.getElementById(this.debugElementId).style.display = ""; +}; diff --git a/image/test/mochitest/bad.jpg b/image/test/mochitest/bad.jpg new file mode 100644 index 0000000000..555a416d7d Binary files /dev/null and b/image/test/mochitest/bad.jpg differ diff --git a/image/test/mochitest/big.png b/image/test/mochitest/big.png new file mode 100644 index 0000000000..94e7eb6db2 Binary files /dev/null and b/image/test/mochitest/big.png differ diff --git a/image/test/mochitest/blue.gif b/image/test/mochitest/blue.gif new file mode 100644 index 0000000000..339f3702fb Binary files /dev/null and b/image/test/mochitest/blue.gif differ diff --git a/image/test/mochitest/blue.png b/image/test/mochitest/blue.png new file mode 100644 index 0000000000..8df58f3a5f Binary files /dev/null and b/image/test/mochitest/blue.png differ diff --git a/image/test/mochitest/bug1132427.gif b/image/test/mochitest/bug1132427.gif new file mode 100644 index 0000000000..39f49689a0 Binary files /dev/null and b/image/test/mochitest/bug1132427.gif differ diff --git a/image/test/mochitest/bug1132427.html b/image/test/mochitest/bug1132427.html new file mode 100644 index 0000000000..c765ce14ca --- /dev/null +++ b/image/test/mochitest/bug1132427.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/image/test/mochitest/bug1180105-waiter.sjs b/image/test/mochitest/bug1180105-waiter.sjs new file mode 100644 index 0000000000..4e86ae2879 --- /dev/null +++ b/image/test/mochitest/bug1180105-waiter.sjs @@ -0,0 +1,24 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ + */ + +var timer = Components.classes["@mozilla.org/timer;1"]; +var waitTimer = timer.createInstance(Components.interfaces.nsITimer); + +function handleRequest(request, response) { + response.setHeader("Content-Type", "text/html", false); + response.setHeader("Cache-Control", "no-cache", false); + response.setStatusLine(request.httpVersion, 200, "OK"); + response.processAsync(); + waitForFinish(response); +} + +function waitForFinish(response) { + if (getSharedState("all-parts-done") === "1") { + response.write("done"); + response.finish(); + } else { + waitTimer.initWithCallback(function() {waitForFinish(response);}, 10, + Components.interfaces.nsITimer.TYPE_ONE_SHOT); + } +} diff --git a/image/test/mochitest/bug1180105.sjs b/image/test/mochitest/bug1180105.sjs new file mode 100644 index 0000000000..e138e548ee --- /dev/null +++ b/image/test/mochitest/bug1180105.sjs @@ -0,0 +1,63 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ + */ + +var counter = 100; +var timer = Components.classes["@mozilla.org/timer;1"]; +var partTimer = timer.createInstance(Components.interfaces.nsITimer); + +function getFileAsInputStream(aFilename) { + var file = Components.classes["@mozilla.org/file/directory_service;1"] + .getService(Components.interfaces.nsIProperties) + .get("CurWorkD", Components.interfaces.nsIFile); + + file.append("tests"); + file.append("image"); + file.append("test"); + file.append("mochitest"); + file.append(aFilename); + + var fileStream = Components.classes['@mozilla.org/network/file-input-stream;1'] + .createInstance(Components.interfaces.nsIFileInputStream); + fileStream.init(file, 1, 0, false); + return fileStream; +} + +function handleRequest(request, response) +{ + response.setHeader("Content-Type", + "multipart/x-mixed-replace;boundary=BOUNDARYOMG", false); + response.setHeader("Cache-Control", "no-cache", false); + response.setStatusLine(request.httpVersion, 200, "OK"); + // We're sending parts off in a delayed fashion, to let the tests occur. + response.processAsync(); + response.write("--BOUNDARYOMG\r\n"); + sendParts(response); +} + +function sendParts(response) { + if (counter-- == 0) { + sendClose(response); + setSharedState("all-parts-done", "1"); + return; + } + sendNextPart(response); + partTimer.initWithCallback(function() {sendParts(response);}, 1, + Components.interfaces.nsITimer.TYPE_ONE_SHOT); +} + +function sendClose(response) { + response.write("--BOUNDARYOMG--\r\n"); + response.finish(); +} + +function sendNextPart(response) { + var nextPartHead = "Content-Type: image/jpeg\r\n\r\n"; + var inputStream = getFileAsInputStream("damon.jpg"); + response.bodyOutputStream.write(nextPartHead, nextPartHead.length); + response.bodyOutputStream.writeFrom(inputStream, inputStream.available()); + inputStream.close(); + // Toss in the boundary, so the browser can know this part is complete + response.write("--BOUNDARYOMG\r\n"); +} + diff --git a/image/test/mochitest/bug1217571-iframe.html b/image/test/mochitest/bug1217571-iframe.html new file mode 100644 index 0000000000..ab243d5cf5 --- /dev/null +++ b/image/test/mochitest/bug1217571-iframe.html @@ -0,0 +1,17 @@ + + + + + iframe for Bug 1217571 + + + + +

+ + + diff --git a/image/test/mochitest/bug1217571.jpg b/image/test/mochitest/bug1217571.jpg new file mode 100644 index 0000000000..917b336607 Binary files /dev/null and b/image/test/mochitest/bug1217571.jpg differ diff --git a/image/test/mochitest/bug1319025-ref.png b/image/test/mochitest/bug1319025-ref.png new file mode 100644 index 0000000000..482d027a02 Binary files /dev/null and b/image/test/mochitest/bug1319025-ref.png differ diff --git a/image/test/mochitest/bug1319025.png b/image/test/mochitest/bug1319025.png new file mode 100644 index 0000000000..8023e77879 Binary files /dev/null and b/image/test/mochitest/bug1319025.png differ diff --git a/image/test/mochitest/bug399925.gif b/image/test/mochitest/bug399925.gif new file mode 100644 index 0000000000..fc1c8f3af0 Binary files /dev/null and b/image/test/mochitest/bug399925.gif differ diff --git a/image/test/mochitest/bug415761.ico b/image/test/mochitest/bug415761.ico new file mode 100644 index 0000000000..d3f65abc23 Binary files /dev/null and b/image/test/mochitest/bug415761.ico differ diff --git a/image/test/mochitest/bug468160.sjs b/image/test/mochitest/bug468160.sjs new file mode 100644 index 0000000000..4a654216a5 --- /dev/null +++ b/image/test/mochitest/bug468160.sjs @@ -0,0 +1,6 @@ +function handleRequest(request, response) +{ + response.setStatusLine("1.1", 302, "Found"); + response.setHeader("Location", "red.png", false); + response.setHeader("Cache-Control", "no-cache", false); +} diff --git a/image/test/mochitest/bug478398_ONLY.png b/image/test/mochitest/bug478398_ONLY.png new file mode 100644 index 0000000000..e094ae2cf4 Binary files /dev/null and b/image/test/mochitest/bug478398_ONLY.png differ diff --git a/image/test/mochitest/bug490949-iframe.html b/image/test/mochitest/bug490949-iframe.html new file mode 100644 index 0000000000..68f74b587e --- /dev/null +++ b/image/test/mochitest/bug490949-iframe.html @@ -0,0 +1,7 @@ + + +Bug 490949 iframe + + + + diff --git a/image/test/mochitest/bug490949.sjs b/image/test/mochitest/bug490949.sjs new file mode 100644 index 0000000000..f306b83372 --- /dev/null +++ b/image/test/mochitest/bug490949.sjs @@ -0,0 +1,33 @@ +function handleRequest(request, response) +{ + var file = Components.classes["@mozilla.org/file/directory_service;1"] + .getService(Components.interfaces.nsIProperties) + .get("CurWorkD", Components.interfaces.nsIFile); + + file.append("tests"); + file.append("image"); + file.append("test"); + file.append("mochitest"); + + var redirectstate = "/image/test/mochitest/bug490949.sjs"; + if (getState(redirectstate) == "") { + file.append('blue.png'); + setState(redirectstate, "red"); + } else { + file.append('red.png'); + setState(redirectstate, ""); + } + response.setHeader("Cache-Control", "no-cache", false); + + var fileStream = Components.classes['@mozilla.org/network/file-input-stream;1'] + .createInstance(Components.interfaces.nsIFileInputStream); + fileStream.init(file, 1, 0, false); + var binaryStream = Components.classes['@mozilla.org/binaryinputstream;1'] + .createInstance(Components.interfaces.nsIBinaryInputStream); + binaryStream.setInputStream(fileStream); + + response.bodyOutputStream.writeFrom(binaryStream, binaryStream.available()); + + binaryStream.close(); + fileStream.close(); +} diff --git a/image/test/mochitest/bug496292-1.sjs b/image/test/mochitest/bug496292-1.sjs new file mode 100644 index 0000000000..3a06b8a468 --- /dev/null +++ b/image/test/mochitest/bug496292-1.sjs @@ -0,0 +1,32 @@ +function handleRequest(request, response) +{ + var file = Components.classes["@mozilla.org/file/directory_service;1"] + .getService(Components.interfaces.nsIProperties) + .get("CurWorkD", Components.interfaces.nsIFile); + + file.append("tests"); + file.append("image"); + file.append("test"); + file.append("mochitest"); + + if (request.getHeader("Accept") == "image/webp,*/*") { + file.append('blue.png'); + } else { + file.append('red.png'); + } + response.setStatusLine(request.httpVersion, 200, "OK"); + response.setHeader("Content-Type", "image/png", false); + response.setHeader("Cache-Control", "no-cache", false); + + var fileStream = Components.classes['@mozilla.org/network/file-input-stream;1'] + .createInstance(Components.interfaces.nsIFileInputStream); + fileStream.init(file, 1, 0, false); + var binaryStream = Components.classes['@mozilla.org/binaryinputstream;1'] + .createInstance(Components.interfaces.nsIBinaryInputStream); + binaryStream.setInputStream(fileStream); + + response.bodyOutputStream.writeFrom(binaryStream, binaryStream.available()); + + binaryStream.close(); + fileStream.close(); +} diff --git a/image/test/mochitest/bug496292-2.sjs b/image/test/mochitest/bug496292-2.sjs new file mode 100644 index 0000000000..756ea9db2a --- /dev/null +++ b/image/test/mochitest/bug496292-2.sjs @@ -0,0 +1,32 @@ +function handleRequest(request, response) +{ + var file = Components.classes["@mozilla.org/file/directory_service;1"] + .getService(Components.interfaces.nsIProperties) + .get("CurWorkD", Components.interfaces.nsIFile); + + file.append("tests"); + file.append("image"); + file.append("test"); + file.append("mochitest"); + + if (request.getHeader("Accept") == "image/png") { + file.append('blue.png'); + } else { + file.append('red.png'); + } + response.setStatusLine(request.httpVersion, 200, "OK"); + response.setHeader("Content-Type", "image/png", false); + response.setHeader("Cache-Control", "no-cache", false); + + var fileStream = Components.classes['@mozilla.org/network/file-input-stream;1'] + .createInstance(Components.interfaces.nsIFileInputStream); + fileStream.init(file, 1, 0, false); + var binaryStream = Components.classes['@mozilla.org/binaryinputstream;1'] + .createInstance(Components.interfaces.nsIBinaryInputStream); + binaryStream.setInputStream(fileStream); + + response.bodyOutputStream.writeFrom(binaryStream, binaryStream.available()); + + binaryStream.close(); + fileStream.close(); +} diff --git a/image/test/mochitest/bug496292-iframe-1.html b/image/test/mochitest/bug496292-iframe-1.html new file mode 100644 index 0000000000..00f0fbcfce --- /dev/null +++ b/image/test/mochitest/bug496292-iframe-1.html @@ -0,0 +1,7 @@ + + +Bug 496292 iframe 1 + + + + diff --git a/image/test/mochitest/bug496292-iframe-2.html b/image/test/mochitest/bug496292-iframe-2.html new file mode 100644 index 0000000000..67c1ecea16 --- /dev/null +++ b/image/test/mochitest/bug496292-iframe-2.html @@ -0,0 +1,7 @@ + + +Bug 496292 iframe 2 + + + + diff --git a/image/test/mochitest/bug496292-iframe-ref.html b/image/test/mochitest/bug496292-iframe-ref.html new file mode 100644 index 0000000000..2e804502e6 --- /dev/null +++ b/image/test/mochitest/bug496292-iframe-ref.html @@ -0,0 +1,7 @@ + + +Bug 496292 reference iframe + + + + diff --git a/image/test/mochitest/bug497665-iframe.html b/image/test/mochitest/bug497665-iframe.html new file mode 100644 index 0000000000..a2b098e31b --- /dev/null +++ b/image/test/mochitest/bug497665-iframe.html @@ -0,0 +1,8 @@ + + +Bug 497665 iframe + + + + + diff --git a/image/test/mochitest/bug497665.sjs b/image/test/mochitest/bug497665.sjs new file mode 100644 index 0000000000..67151e25b8 --- /dev/null +++ b/image/test/mochitest/bug497665.sjs @@ -0,0 +1,34 @@ +function handleRequest(request, response) +{ + var file = Components.classes["@mozilla.org/file/directory_service;1"] + .getService(Components.interfaces.nsIProperties) + .get("CurWorkD", Components.interfaces.nsIFile); + + file.append("tests"); + file.append("image"); + file.append("test"); + file.append("mochitest"); + + var redirectstate = "/image/test/mochitest/bug497665.sjs"; + if (getState(redirectstate) == "") { + file.append('blue.png'); + setState(redirectstate, "red"); + } else { + file.append('red.png'); + setState(redirectstate, ""); + } + + response.setHeader("Cache-Control", "max-age=3600", false); + + var fileStream = Components.classes['@mozilla.org/network/file-input-stream;1'] + .createInstance(Components.interfaces.nsIFileInputStream); + fileStream.init(file, 1, 0, false); + var binaryStream = Components.classes['@mozilla.org/binaryinputstream;1'] + .createInstance(Components.interfaces.nsIBinaryInputStream); + binaryStream.setInputStream(fileStream); + + response.bodyOutputStream.writeFrom(binaryStream, binaryStream.available()); + + binaryStream.close(); + fileStream.close(); +} diff --git a/image/test/mochitest/bug552605.sjs b/image/test/mochitest/bug552605.sjs new file mode 100644 index 0000000000..806a065b47 --- /dev/null +++ b/image/test/mochitest/bug552605.sjs @@ -0,0 +1,13 @@ +function handleRequest(request, response) +{ + var redirectstate = "/image/test/mochitest/bug89419.sjs"; + response.setStatusLine("1.1", 302, "Found"); + if (getState(redirectstate) == "") { + response.setHeader("Location", "red.png", false); + setState(redirectstate, "red"); + } else { + response.setHeader("Location", "blue.png", false); + setState(redirectstate, ""); + } + response.setHeader("Cache-Control", "no-cache", false); +} diff --git a/image/test/mochitest/bug657191.sjs b/image/test/mochitest/bug657191.sjs new file mode 100644 index 0000000000..7451d98ee3 --- /dev/null +++ b/image/test/mochitest/bug657191.sjs @@ -0,0 +1,27 @@ +function handleRequest(request, response) +{ + var file = Components.classes["@mozilla.org/file/directory_service;1"] + .getService(Components.interfaces.nsIProperties) + .get("CurWorkD", Components.interfaces.nsIFile); + + file.append("tests"); + file.append("image"); + file.append("test"); + file.append("mochitest"); + file.append('lime100x100.svg'); + + response.setStatusLine("1.1", 500, "Internal Server Error"); + response.setHeader("Content-Type", "image/svg+xml", false); + + var fileStream = Components.classes['@mozilla.org/network/file-input-stream;1'] + .createInstance(Components.interfaces.nsIFileInputStream); + fileStream.init(file, 1, 0, false); + var binaryStream = Components.classes['@mozilla.org/binaryinputstream;1'] + .createInstance(Components.interfaces.nsIBinaryInputStream); + binaryStream.setInputStream(fileStream); + + response.bodyOutputStream.writeFrom(binaryStream, binaryStream.available()); + + binaryStream.close(); + fileStream.close(); +} diff --git a/image/test/mochitest/bug671906-iframe.html b/image/test/mochitest/bug671906-iframe.html new file mode 100644 index 0000000000..87f8183a4d --- /dev/null +++ b/image/test/mochitest/bug671906-iframe.html @@ -0,0 +1,7 @@ + + +Bug 671906 iframe + + + + diff --git a/image/test/mochitest/bug671906.sjs b/image/test/mochitest/bug671906.sjs new file mode 100644 index 0000000000..f1fbc1b737 --- /dev/null +++ b/image/test/mochitest/bug671906.sjs @@ -0,0 +1,36 @@ +function handleRequest(request, response) +{ + var file = Components.classes["@mozilla.org/file/directory_service;1"] + .getService(Components.interfaces.nsIProperties) + .get("CurWorkD", Components.interfaces.nsIFile); + + file.append("tests"); + file.append("image"); + file.append("test"); + file.append("mochitest"); + + var filestate = "/image/test/mochitest/bug671906.sjs"; + if (getState(filestate) == "") { + file.append('blue.png'); + setState(filestate, "red"); + } else { + file.append('red.png'); + setState(filestate, ""); + } + + // Set the expires date to some silly time in the future so we're sure to + // *want* to cache this image. + var date = new Date(); + date.setFullYear(date.getFullYear() + 1); + response.setHeader("Expires", date.toUTCString(), false); + + var fileStream = Components.classes['@mozilla.org/network/file-input-stream;1'] + .createInstance(Components.interfaces.nsIFileInputStream); + fileStream.init(file, 1, 0, false); + + response.bodyOutputStream.writeFrom(fileStream, fileStream.available()); + + fileStream.close(); + + response.setHeader("Access-Control-Allow-Origin", "*", false); +} diff --git a/image/test/mochitest/bug733553-informant.sjs b/image/test/mochitest/bug733553-informant.sjs new file mode 100644 index 0000000000..6f15a11957 --- /dev/null +++ b/image/test/mochitest/bug733553-informant.sjs @@ -0,0 +1,15 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ + */ + +function handleRequest(request, response) +{ + response.setHeader("Content-Type", "text/plain", false); + response.setHeader("Cache-Control", "no-cache", false); + response.setStatusLine(request.httpVersion, 200, "OK"); + // Tells bug733553.sjs that the consumer is ready for the next part + let partName = request.queryString; + setSharedState("next-part", partName); + response.write("OK!"); +} + diff --git a/image/test/mochitest/bug733553.sjs b/image/test/mochitest/bug733553.sjs new file mode 100644 index 0000000000..c5279f3d2d --- /dev/null +++ b/image/test/mochitest/bug733553.sjs @@ -0,0 +1,104 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ + */ + +var bodyPartIndex = -1; +var bodyParts = [ + ["red.png", "image/png"], + ["animated-gif2.gif", "image/gif"], + ["red.png", "image/png"], + ["lime100x100.svg", "image/svg+xml"], + ["lime100x100.svg", "image/svg+xml"], + ["animated-gif2.gif", "image/gif"], + ["red.png", "image/png"], + // Mime type intentionally wrong (test for bug 907575) + ["shaver.png", "image/gif"], + ["red.png", "image/png"], + ["damon.jpg", "image/jpeg"], + ["damon.jpg", "application/octet-stream"], + ["damon.jpg", "image/jpeg"], + ["rillybad.jpg", "application/x-unknown-content-type"], + ["damon.jpg", "image/jpeg"], + ["bad.jpg", "image/jpeg"], + ["red.png", "image/png"], + ["invalid.jpg", "image/jpeg"], + ["animated-gif2.gif", "image/gif"] +]; +var timer = Components.classes["@mozilla.org/timer;1"]; +var partTimer = timer.createInstance(Components.interfaces.nsITimer); + +function getFileAsInputStream(aFilename) { + var file = Components.classes["@mozilla.org/file/directory_service;1"] + .getService(Components.interfaces.nsIProperties) + .get("CurWorkD", Components.interfaces.nsIFile); + + file.append("tests"); + file.append("image"); + file.append("test"); + file.append("mochitest"); + file.append(aFilename); + + var fileStream = Components.classes['@mozilla.org/network/file-input-stream;1'] + .createInstance(Components.interfaces.nsIFileInputStream); + fileStream.init(file, 1, 0, false); + return fileStream; +} + +function handleRequest(request, response) +{ + if (!getSharedState("next-part")) { + setSharedState("next-part", "-1"); + } + response.setHeader("Content-Type", + "multipart/x-mixed-replace;boundary=BOUNDARYOMG", false); + response.setHeader("Cache-Control", "no-cache", false); + response.setStatusLine(request.httpVersion, 200, "OK"); + // We're sending parts off in a delayed fashion, to let the tests occur. + response.processAsync(); + response.write("--BOUNDARYOMG\r\n"); + sendParts(response); +} + +function sendParts(response) { + let wait = false; + let nextPart = parseInt(getSharedState("next-part"), 10); + if (nextPart == bodyPartIndex) { + // Haven't been signaled yet, remain in holding pattern + wait = true; + } else { + bodyPartIndex = nextPart; + } + if (bodyParts.length > bodyPartIndex) { + let callback; + if (!wait) { + callback = getSendNextPart(response); + } else { + callback = function () { sendParts(response); }; + } + partTimer.initWithCallback(callback, 1000, + Components.interfaces.nsITimer.TYPE_ONE_SHOT); + } + else { + sendClose(response); + } +} + +function sendClose(response) { + response.write("--BOUNDARYOMG--\r\n"); + response.finish(); +} + +function getSendNextPart(response) { + var part = bodyParts[bodyPartIndex]; + var nextPartHead = "Content-Type: " + part[1] + "\r\n\r\n"; + var inputStream = getFileAsInputStream(part[0]); + return function () { + response.bodyOutputStream.write(nextPartHead, nextPartHead.length); + response.bodyOutputStream.writeFrom(inputStream, inputStream.available()); + inputStream.close(); + // Toss in the boundary, so the browser can know this part is complete + response.write("--BOUNDARYOMG\r\n"); + sendParts(response); + } +} + diff --git a/image/test/mochitest/bug767779.sjs b/image/test/mochitest/bug767779.sjs new file mode 100644 index 0000000000..9a7948d85d --- /dev/null +++ b/image/test/mochitest/bug767779.sjs @@ -0,0 +1,56 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ + */ + +var timer = Components.classes["@mozilla.org/timer;1"]; +var partTimer = timer.createInstance(Components.interfaces.nsITimer); + +function getFileAsInputStream(aFilename) { + var file = Components.classes["@mozilla.org/file/directory_service;1"] + .getService(Components.interfaces.nsIProperties) + .get("CurWorkD", Components.interfaces.nsIFile); + + file.append("tests"); + file.append("image"); + file.append("test"); + file.append("mochitest"); + file.append(aFilename); + + var fileStream = Components.classes['@mozilla.org/network/file-input-stream;1'] + .createInstance(Components.interfaces.nsIFileInputStream); + fileStream.init(file, 1, 0, false); + return fileStream; +} + +function handleRequest(request, response) +{ + response.setHeader("Content-Type", "image/gif", false); + response.setHeader("Cache-Control", "no-cache", false); + response.setStatusLine(request.httpVersion, 200, "OK"); + // We're sending data off in a delayed fashion + response.processAsync(); + var inputStream = getFileAsInputStream("animated-gif_trailing-garbage.gif"); + var available = inputStream.available(); // = 4029 bytes + // Send the good data at once + response.bodyOutputStream.writeFrom(inputStream, 285); + sendParts(inputStream, response); +} + +function sendParts(inputStream, response) { + // 3744 left, send in 8 chunks of 468 each + partTimer.initWithCallback(getSendNextPart(inputStream, response), 500, + Components.interfaces.nsITimer.TYPE_ONE_SHOT); +} + +function getSendNextPart(inputStream, response) { + return function () { + response.bodyOutputStream.writeFrom(inputStream, 468); + if (!inputStream.available()) { + inputStream.close(); + response.finish(); + } else { + sendParts(inputStream, response); + } + }; +} + diff --git a/image/test/mochitest/bug89419-iframe.html b/image/test/mochitest/bug89419-iframe.html new file mode 100644 index 0000000000..1915315633 --- /dev/null +++ b/image/test/mochitest/bug89419-iframe.html @@ -0,0 +1,7 @@ + + +Bug 89419 iframe + + + + diff --git a/image/test/mochitest/bug89419.sjs b/image/test/mochitest/bug89419.sjs new file mode 100644 index 0000000000..806a065b47 --- /dev/null +++ b/image/test/mochitest/bug89419.sjs @@ -0,0 +1,13 @@ +function handleRequest(request, response) +{ + var redirectstate = "/image/test/mochitest/bug89419.sjs"; + response.setStatusLine("1.1", 302, "Found"); + if (getState(redirectstate) == "") { + response.setHeader("Location", "red.png", false); + setState(redirectstate, "red"); + } else { + response.setHeader("Location", "blue.png", false); + setState(redirectstate, ""); + } + response.setHeader("Cache-Control", "no-cache", false); +} diff --git a/image/test/mochitest/bug900200-ref.png b/image/test/mochitest/bug900200-ref.png new file mode 100644 index 0000000000..6360131325 Binary files /dev/null and b/image/test/mochitest/bug900200-ref.png differ diff --git a/image/test/mochitest/bug900200.png b/image/test/mochitest/bug900200.png new file mode 100644 index 0000000000..d7d87adce0 Binary files /dev/null and b/image/test/mochitest/bug900200.png differ diff --git a/image/test/mochitest/child.html b/image/test/mochitest/child.html new file mode 100644 index 0000000000..19f262ec3a --- /dev/null +++ b/image/test/mochitest/child.html @@ -0,0 +1,22 @@ + + + + + diff --git a/image/test/mochitest/chrome.ini b/image/test/mochitest/chrome.ini new file mode 100644 index 0000000000..b84d0af897 --- /dev/null +++ b/image/test/mochitest/chrome.ini @@ -0,0 +1,7 @@ +[DEFAULT] +skip-if = os == 'android' + +[test_bug415761.html] +skip-if = os != "win" || os_version == "6.2" +support-files = + bug415761.ico diff --git a/image/test/mochitest/clear.gif b/image/test/mochitest/clear.gif new file mode 100644 index 0000000000..7ae79ba86e Binary files /dev/null and b/image/test/mochitest/clear.gif differ diff --git a/image/test/mochitest/clear.png b/image/test/mochitest/clear.png new file mode 100644 index 0000000000..b09aecaaa0 Binary files /dev/null and b/image/test/mochitest/clear.png differ diff --git a/image/test/mochitest/clear.webp b/image/test/mochitest/clear.webp new file mode 100644 index 0000000000..6db376d6e1 Binary files /dev/null and b/image/test/mochitest/clear.webp differ diff --git a/image/test/mochitest/clear2-results.gif b/image/test/mochitest/clear2-results.gif new file mode 100644 index 0000000000..965b650253 Binary files /dev/null and b/image/test/mochitest/clear2-results.gif differ diff --git a/image/test/mochitest/clear2.gif b/image/test/mochitest/clear2.gif new file mode 100644 index 0000000000..00ad873c65 Binary files /dev/null and b/image/test/mochitest/clear2.gif differ diff --git a/image/test/mochitest/clear2.webp b/image/test/mochitest/clear2.webp new file mode 100644 index 0000000000..e4a3e2efab Binary files /dev/null and b/image/test/mochitest/clear2.webp differ diff --git a/image/test/mochitest/damon.jpg b/image/test/mochitest/damon.jpg new file mode 100644 index 0000000000..917b336607 Binary files /dev/null and b/image/test/mochitest/damon.jpg differ diff --git a/image/test/mochitest/error-early.png b/image/test/mochitest/error-early.png new file mode 100644 index 0000000000..5df7507e2d --- /dev/null +++ b/image/test/mochitest/error-early.png @@ -0,0 +1 @@ +ERROR diff --git a/image/test/mochitest/filter-final.svg b/image/test/mochitest/filter-final.svg new file mode 100644 index 0000000000..b2b3dca008 --- /dev/null +++ b/image/test/mochitest/filter-final.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/image/test/mochitest/filter.svg b/image/test/mochitest/filter.svg new file mode 100644 index 0000000000..e185f15b69 --- /dev/null +++ b/image/test/mochitest/filter.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/image/test/mochitest/finite-apng.png b/image/test/mochitest/finite-apng.png new file mode 100644 index 0000000000..778613d851 Binary files /dev/null and b/image/test/mochitest/finite-apng.png differ diff --git a/image/test/mochitest/first-frame-padding.gif b/image/test/mochitest/first-frame-padding.gif new file mode 100644 index 0000000000..e6d7c49322 Binary files /dev/null and b/image/test/mochitest/first-frame-padding.gif differ diff --git a/image/test/mochitest/green-background.html b/image/test/mochitest/green-background.html new file mode 100644 index 0000000000..6b4518e734 --- /dev/null +++ b/image/test/mochitest/green-background.html @@ -0,0 +1,29 @@ + + + +Background color wrapper for clear image tests + + + + + + + + diff --git a/image/test/mochitest/green.png b/image/test/mochitest/green.png new file mode 100644 index 0000000000..7df25f33bd Binary files /dev/null and b/image/test/mochitest/green.png differ diff --git a/image/test/mochitest/grey.png b/image/test/mochitest/grey.png new file mode 100644 index 0000000000..5c82cdeb10 Binary files /dev/null and b/image/test/mochitest/grey.png differ diff --git a/image/test/mochitest/ico-bmp-opaque.ico b/image/test/mochitest/ico-bmp-opaque.ico new file mode 100644 index 0000000000..3cf3320eae Binary files /dev/null and b/image/test/mochitest/ico-bmp-opaque.ico differ diff --git a/image/test/mochitest/ico-bmp-transparent.ico b/image/test/mochitest/ico-bmp-transparent.ico new file mode 100644 index 0000000000..151b7cb361 Binary files /dev/null and b/image/test/mochitest/ico-bmp-transparent.ico differ diff --git a/image/test/mochitest/iframe.html b/image/test/mochitest/iframe.html new file mode 100644 index 0000000000..6d66557ef8 --- /dev/null +++ b/image/test/mochitest/iframe.html @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/image/test/mochitest/imgutils.js b/image/test/mochitest/imgutils.js new file mode 100644 index 0000000000..b16ad1d065 --- /dev/null +++ b/image/test/mochitest/imgutils.js @@ -0,0 +1,137 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +// Helper file for shared image functionality +// +// Note that this is use by tests elsewhere in the source tree. When in doubt, +// check mxr before removing or changing functionality. + +// Helper function to clear both the content and chrome image caches +function clearAllImageCaches() { + var tools = SpecialPowers.Cc["@mozilla.org/image/tools;1"].getService( + SpecialPowers.Ci.imgITools + ); + var imageCache = tools.getImgCacheForDocument(window.document); + imageCache.clearCache(true); // true=chrome + imageCache.clearCache(false); // false=content +} + +// Helper function to clear the image cache of content images +function clearImageCache() { + var tools = SpecialPowers.Cc["@mozilla.org/image/tools;1"].getService( + SpecialPowers.Ci.imgITools + ); + var imageCache = tools.getImgCacheForDocument(window.document); + imageCache.clearCache(false); // true=chrome, false=content +} + +// Helper function to determine if the frame is decoded for a given image id +function isFrameDecoded(id) { + return !!( + getImageStatus(id) & SpecialPowers.Ci.imgIRequest.STATUS_FRAME_COMPLETE + ); +} + +// Helper function to determine if the image is loaded for a given image id +function isImageLoaded(id) { + return !!( + getImageStatus(id) & SpecialPowers.Ci.imgIRequest.STATUS_LOAD_COMPLETE + ); +} + +// Helper function to get the status flags of an image +function getImageStatus(id) { + // Get the image + var img = SpecialPowers.wrap(document.getElementById(id)); + + // Get the request + var request = img.getRequest( + SpecialPowers.Ci.nsIImageLoadingContent.CURRENT_REQUEST + ); + + // Return the status + return request.imageStatus; +} + +// Forces a synchronous decode of an image by drawing it to a canvas. Only +// really meaningful if the image is fully loaded first +function forceDecode(id) { + // Get the image + var img = document.getElementById(id); + + // Make a new canvas + var canvas = document.createElement("canvas"); + + // Draw the image to the canvas. This forces a synchronous decode + var ctx = canvas.getContext("2d"); + ctx.drawImage(img, 0, 0); +} + +// Functions to facilitate getting/setting various image-related prefs +// +// If you change a pref in a mochitest, Don't forget to reset it to its +// original value! +// +// Null indicates no pref set + +const DISCARD_ENABLED_PREF = { + name: "discardable", + branch: "image.mem.", + type: "bool", +}; +const DECODEONDRAW_ENABLED_PREF = { + name: "decodeondraw", + branch: "image.mem.", + type: "bool", +}; +const DISCARD_TIMEOUT_PREF = { + name: "min_discard_timeout_ms", + branch: "image.mem.", + type: "int", +}; + +function setImagePref(pref, val) { + var prefService = SpecialPowers.Services.prefs; + var branch = prefService.getBranch(pref.branch); + if (val != null) { + switch (pref.type) { + case "bool": + branch.setBoolPref(pref.name, val); + break; + case "int": + branch.setIntPref(pref.name, val); + break; + default: + throw new Error("Unknown pref type"); + } + } else if (branch.prefHasUserValue(pref.name)) { + branch.clearUserPref(pref.name); + } +} + +function getImagePref(pref) { + var prefService = SpecialPowers.Services.prefs; + var branch = prefService.getBranch(pref.branch); + if (branch.prefHasUserValue(pref.name)) { + switch (pref.type) { + case "bool": + return branch.getBoolPref(pref.name); + case "int": + return branch.getIntPref(pref.name); + default: + throw new Error("Unknown pref type"); + } + } else { + return null; + } +} + +// JS implementation of imgIScriptedNotificationObserver with stubs for all of its methods. +function ImageDecoderObserverStub() { + this.sizeAvailable = function sizeAvailable(aRequest) {}; + this.frameComplete = function frameComplete(aRequest) {}; + this.decodeComplete = function decodeComplete(aRequest) {}; + this.loadComplete = function loadComplete(aRequest) {}; + this.frameUpdate = function frameUpdate(aRequest) {}; + this.discard = function discard(aRequest) {}; + this.isAnimated = function isAnimated(aRequest) {}; + this.hasTransparency = function hasTransparency(aRequest) {}; +} diff --git a/image/test/mochitest/infinite-apng.png b/image/test/mochitest/infinite-apng.png new file mode 100644 index 0000000000..637dafbc2b Binary files /dev/null and b/image/test/mochitest/infinite-apng.png differ diff --git a/image/test/mochitest/infinite.webp b/image/test/mochitest/infinite.webp new file mode 100644 index 0000000000..4219e179b0 Binary files /dev/null and b/image/test/mochitest/infinite.webp differ diff --git a/image/test/mochitest/invalid.jpg b/image/test/mochitest/invalid.jpg new file mode 100644 index 0000000000..c677a81e29 --- /dev/null +++ b/image/test/mochitest/invalid.jpg @@ -0,0 +1 @@ +notajpg diff --git a/image/test/mochitest/keep.gif b/image/test/mochitest/keep.gif new file mode 100644 index 0000000000..e967d6a6dc Binary files /dev/null and b/image/test/mochitest/keep.gif differ diff --git a/image/test/mochitest/keep.png b/image/test/mochitest/keep.png new file mode 100644 index 0000000000..aa3ff74450 Binary files /dev/null and b/image/test/mochitest/keep.png differ diff --git a/image/test/mochitest/keep.webp b/image/test/mochitest/keep.webp new file mode 100644 index 0000000000..342982be06 Binary files /dev/null and b/image/test/mochitest/keep.webp differ diff --git a/image/test/mochitest/lime-anim-100x100-2.svg b/image/test/mochitest/lime-anim-100x100-2.svg new file mode 100644 index 0000000000..d19d3b0e7e --- /dev/null +++ b/image/test/mochitest/lime-anim-100x100-2.svg @@ -0,0 +1,6 @@ + + + + + diff --git a/image/test/mochitest/lime-anim-100x100.svg b/image/test/mochitest/lime-anim-100x100.svg new file mode 100644 index 0000000000..c6584047d0 --- /dev/null +++ b/image/test/mochitest/lime-anim-100x100.svg @@ -0,0 +1,7 @@ + + + + + + diff --git a/image/test/mochitest/lime-css-anim-100x100.svg b/image/test/mochitest/lime-css-anim-100x100.svg new file mode 100644 index 0000000000..3edbd3eaaf --- /dev/null +++ b/image/test/mochitest/lime-css-anim-100x100.svg @@ -0,0 +1,19 @@ + + + + + + + diff --git a/image/test/mochitest/lime100x100.svg b/image/test/mochitest/lime100x100.svg new file mode 100644 index 0000000000..8bdec62c1f --- /dev/null +++ b/image/test/mochitest/lime100x100.svg @@ -0,0 +1,4 @@ + + + diff --git a/image/test/mochitest/mochitest.ini b/image/test/mochitest/mochitest.ini new file mode 100644 index 0000000000..ad9e18a119 --- /dev/null +++ b/image/test/mochitest/mochitest.ini @@ -0,0 +1,162 @@ +[DEFAULT] +support-files = + INT32_MIN.bmp + animated1.gif + animated2.gif + animated-gif.gif + animated-gif2.gif + animated-gif_trailing-garbage.gif + animated-gif-finalframe.gif + animation.svg + animationPolling.js + bad.jpg + big.png + blue.gif + blue.png + bug399925.gif + bug468160.sjs + bug478398_ONLY.png + bug490949-iframe.html + bug490949.sjs + bug496292-1.sjs + bug496292-2.sjs + bug496292-iframe-1.html + bug496292-iframe-2.html + bug496292-iframe-ref.html + bug497665-iframe.html + bug497665.sjs + bug552605.sjs + bug657191.sjs + bug671906-iframe.html + bug671906.sjs + bug733553-informant.sjs + bug733553.sjs + bug767779.sjs + bug89419-iframe.html + bug89419.sjs + bug900200.png + bug900200-ref.png + bug1132427.html + bug1132427.gif + bug1180105.sjs + bug1180105-waiter.sjs + bug1217571-iframe.html + bug1217571.jpg + bug1319025.png + bug1319025-ref.png + clear.gif + clear.png + clear.webp + clear2.gif + clear2.webp + clear2-results.gif + damon.jpg + error-early.png + filter-final.svg + filter.svg + finite-apng.png + first-frame-padding.gif + green.png + green-background.html + grey.png + ico-bmp-opaque.ico + ico-bmp-transparent.ico + iframe.html + imgutils.js + infinite.webp + infinite-apng.png + invalid.jpg + keep.gif + keep.png + keep.webp + lime100x100.svg + lime-anim-100x100.svg + lime-anim-100x100-2.svg + lime-css-anim-100x100.svg + mq_dynamic_svg_test.html + mq_dynamic_svg_ref.html + opaque.bmp + purple.gif + rainbow.gif + red.gif + red.png + ref-iframe.html + restore-previous.gif + restore-previous.png + rillybad.jpg + schrep.png + shaver.png + short_header.gif + source.png + transparent.gif + transparent.png + over.png + webcam-simulacrum.sjs + 6M-pixels.png + 12M-pixels-1.png + 12M-pixels-2.png + +[test_animated_css_image.html] +[test_animated_gif.html] +support-files = child.html +[test_animation.html] +[test_canvas_frame_animation.html] +[test_animation_operators.html] +[test_animation2.html] +[test_animSVGImage.html] +skip-if = os == 'android' || os == 'win' || (os == 'mac' && os_version == '10.14') # Bug 1370784, macosx due to bug 1549058 +[test_animSVGImage2.html] +skip-if = (webrender && os == 'win') || (webrender && os == 'linux') #Bug 1354561 +[test_background_image_anim.html] +[test_bug399925.html] +[test_bug435296.html] +skip-if = true # disabled - See bug 578591 +[test_bug466586.html] +[test_bug468160.html] +[test_bug478398.html] +skip-if = true # disabled - See bug 579139 +[test_bug490949.html] +[test_bug496292.html] +skip-if = verify +[test_bug497665.html] +[test_bug552605-1.html] +[test_bug552605-2.html] +[test_bug553982.html] +[test_bug601470.html] +[test_bug614392.html] +[test_bug657191.html] +[test_bug671906.html] +[test_bug733553.html] +skip-if = verify +[test_bug767779.html] +[test_bug865919.html] +[test_bug89419-1.html] +[test_bug89419-2.html] +[test_bug1132427.html] +[test_bug1180105.html] +[test_bug1217571.html] +[test_bug1325080.html] +[test_bullet_animation.html] +[test_changeOfSource.html] +[test_changeOfSource2.html] +[test_discardAnimatedImage.html] +[test_discardFinishedAnimatedImage.html] +[test_discardFramesAnimatedImage.html] +[test_drawDiscardedImage.html] +[test_error_events.html] +[test_image_crossorigin_data_url.html] +[test_has_transparency.html] +[test_mq_dynamic_svg.html] +[test_net_failedtoprocess.html] +skip-if = verify +[test_removal_ondecode.html] +[test_removal_onload.html] +[test_short_gif_header.html] +[test_staticClone.html] +[test_svg_animatedGIF.html] +[test_svg_filter_animation.html] +[test_synchronized_animation.html] +disabled = bug 1295501 +[test_undisplayed_iframe.html] +[test_webcam.html] +[test_xultree_animation.xhtml] diff --git a/image/test/mochitest/mq_dynamic_svg_ref.html b/image/test/mochitest/mq_dynamic_svg_ref.html new file mode 100644 index 0000000000..bbd4a3e205 --- /dev/null +++ b/image/test/mochitest/mq_dynamic_svg_ref.html @@ -0,0 +1,38 @@ + + + + +

inline

+ + + +

iframe

+ +

img

+ +

background-image

+
+

img with nested document

+ diff --git a/image/test/mochitest/mq_dynamic_svg_test.html b/image/test/mochitest/mq_dynamic_svg_test.html new file mode 100644 index 0000000000..8acb6d3331 --- /dev/null +++ b/image/test/mochitest/mq_dynamic_svg_test.html @@ -0,0 +1,61 @@ + + + + +

inline

+ + + +

iframe

+ +

img

+ +

background-image

+
+

img with nested document

+ diff --git a/image/test/mochitest/opaque.bmp b/image/test/mochitest/opaque.bmp new file mode 100644 index 0000000000..63d3f1c058 Binary files /dev/null and b/image/test/mochitest/opaque.bmp differ diff --git a/image/test/mochitest/over.png b/image/test/mochitest/over.png new file mode 100644 index 0000000000..9e957182f7 Binary files /dev/null and b/image/test/mochitest/over.png differ diff --git a/image/test/mochitest/purple.gif b/image/test/mochitest/purple.gif new file mode 100644 index 0000000000..79826af205 Binary files /dev/null and b/image/test/mochitest/purple.gif differ diff --git a/image/test/mochitest/rainbow.gif b/image/test/mochitest/rainbow.gif new file mode 100644 index 0000000000..a247a80df0 Binary files /dev/null and b/image/test/mochitest/rainbow.gif differ diff --git a/image/test/mochitest/red.gif b/image/test/mochitest/red.gif new file mode 100644 index 0000000000..d3c32bae25 Binary files /dev/null and b/image/test/mochitest/red.gif differ diff --git a/image/test/mochitest/red.png b/image/test/mochitest/red.png new file mode 100644 index 0000000000..aa9ce25263 Binary files /dev/null and b/image/test/mochitest/red.png differ diff --git a/image/test/mochitest/ref-iframe.html b/image/test/mochitest/ref-iframe.html new file mode 100644 index 0000000000..585772c8a9 --- /dev/null +++ b/image/test/mochitest/ref-iframe.html @@ -0,0 +1,6 @@ + + +
+ + diff --git a/image/test/mochitest/restore-previous.gif b/image/test/mochitest/restore-previous.gif new file mode 100644 index 0000000000..15ba9ddc48 Binary files /dev/null and b/image/test/mochitest/restore-previous.gif differ diff --git a/image/test/mochitest/restore-previous.png b/image/test/mochitest/restore-previous.png new file mode 100644 index 0000000000..09dee63820 Binary files /dev/null and b/image/test/mochitest/restore-previous.png differ diff --git a/image/test/mochitest/rillybad.jpg b/image/test/mochitest/rillybad.jpg new file mode 100644 index 0000000000..e2fb1d303f Binary files /dev/null and b/image/test/mochitest/rillybad.jpg differ diff --git a/image/test/mochitest/schrep.png b/image/test/mochitest/schrep.png new file mode 100644 index 0000000000..bcb406387d Binary files /dev/null and b/image/test/mochitest/schrep.png differ diff --git a/image/test/mochitest/shaver.png b/image/test/mochitest/shaver.png new file mode 100644 index 0000000000..ab0b6c7b40 Binary files /dev/null and b/image/test/mochitest/shaver.png differ diff --git a/image/test/mochitest/short_header.gif b/image/test/mochitest/short_header.gif new file mode 100644 index 0000000000..70af95ac6d Binary files /dev/null and b/image/test/mochitest/short_header.gif differ diff --git a/image/test/mochitest/source.png b/image/test/mochitest/source.png new file mode 100644 index 0000000000..df1c76dae5 Binary files /dev/null and b/image/test/mochitest/source.png differ diff --git a/image/test/mochitest/test_animSVGImage.html b/image/test/mochitest/test_animSVGImage.html new file mode 100644 index 0000000000..a405cdd46b --- /dev/null +++ b/image/test/mochitest/test_animSVGImage.html @@ -0,0 +1,124 @@ + + + + + Test for Bug 610419 + + + + + + +Mozilla Bug 610419 +

+
+
+ +
+
+
+
+ + diff --git a/image/test/mochitest/test_animSVGImage2.html b/image/test/mochitest/test_animSVGImage2.html new file mode 100644 index 0000000000..0f3ae046c5 --- /dev/null +++ b/image/test/mochitest/test_animSVGImage2.html @@ -0,0 +1,124 @@ + + + + + Test for Bug 907503 + + + + + + +Mozilla Bug 907503 +

+
+
+ +
+
+
+
+ + diff --git a/image/test/mochitest/test_animated_css_image.html b/image/test/mochitest/test_animated_css_image.html new file mode 100644 index 0000000000..c9c77ff444 --- /dev/null +++ b/image/test/mochitest/test_animated_css_image.html @@ -0,0 +1,165 @@ + + + + + + diff --git a/image/test/mochitest/test_animated_gif.html b/image/test/mochitest/test_animated_gif.html new file mode 100644 index 0000000000..814749b7f0 --- /dev/null +++ b/image/test/mochitest/test_animated_gif.html @@ -0,0 +1,50 @@ + + + + +Images outside of display port are not decoded + + + + + +

+ +
+
+ +
+
+

+
+
+
diff --git a/image/test/mochitest/test_animation.html b/image/test/mochitest/test_animation.html
new file mode 100644
index 0000000000..725cd93e85
--- /dev/null
+++ b/image/test/mochitest/test_animation.html
@@ -0,0 +1,45 @@
+
+
+
+
+  Test for Bug 666446 - General Animated GIF Test
+  
+  
+  
+  
+  
+
+
+
+Mozilla Bug 666446: lots of animated gifs swamp us with paint events
+
+

+ +
+
+
+ +
+
+ +
+
+
+
+ + diff --git a/image/test/mochitest/test_animation2.html b/image/test/mochitest/test_animation2.html new file mode 100644 index 0000000000..1b4e0f94c7 --- /dev/null +++ b/image/test/mochitest/test_animation2.html @@ -0,0 +1,49 @@ + + + + + Test for Bug 705580 - General Animated GIF Test 2 + + + + + + + + +Mozilla Bug 705580: Test animated GIFs that are converted to ImageLayers + +

+ +
+ +
+
+ +
+
+ +
+
+
+
+ + diff --git a/image/test/mochitest/test_animation_operators.html b/image/test/mochitest/test_animation_operators.html new file mode 100644 index 0000000000..31f1108362 --- /dev/null +++ b/image/test/mochitest/test_animation_operators.html @@ -0,0 +1,167 @@ + + + + + Test for Bug 936720 + + + + + +Mozilla Bug 936720 +
+
+
+ + diff --git a/image/test/mochitest/test_background_image_anim.html b/image/test/mochitest/test_background_image_anim.html new file mode 100644 index 0000000000..f1aeb6288b --- /dev/null +++ b/image/test/mochitest/test_background_image_anim.html @@ -0,0 +1,44 @@ + + + + + Test for Bug 666446 - Animated Background Images + + + + + + + + +Mozilla Bug 666446: lots of animated gifs swamp us with paint events + +

+
+
+ +
+ +
+
+
+ + diff --git a/image/test/mochitest/test_bug1132427.html b/image/test/mochitest/test_bug1132427.html new file mode 100644 index 0000000000..0ee2872fea --- /dev/null +++ b/image/test/mochitest/test_bug1132427.html @@ -0,0 +1,94 @@ + + + + Test for scrolling selection into view + + + + + + +
+
+
+ + + diff --git a/image/test/mochitest/test_bug1180105.html b/image/test/mochitest/test_bug1180105.html new file mode 100644 index 0000000000..579c8db760 --- /dev/null +++ b/image/test/mochitest/test_bug1180105.html @@ -0,0 +1,46 @@ + + + + + Test for Bug 1180105 + + + + + +Mozilla Bug 1180105 +

+
+
+
+
> + +
+ + diff --git a/image/test/mochitest/test_bug1217571.html b/image/test/mochitest/test_bug1217571.html new file mode 100644 index 0000000000..f81fc7c51d --- /dev/null +++ b/image/test/mochitest/test_bug1217571.html @@ -0,0 +1,43 @@ + + + + + Test for Bug 1217571 + + + + +Mozilla Bug 1217571 +

+ + +
+
+
+ + diff --git a/image/test/mochitest/test_bug1325080.html b/image/test/mochitest/test_bug1325080.html new file mode 100644 index 0000000000..91dea11173 --- /dev/null +++ b/image/test/mochitest/test_bug1325080.html @@ -0,0 +1,37 @@ + + + + + Test for Bug 1325080 + + + + +Mozilla Bug 1325080 +
+
+
+ + diff --git a/image/test/mochitest/test_bug399925.html b/image/test/mochitest/test_bug399925.html new file mode 100644 index 0000000000..ae45479377 --- /dev/null +++ b/image/test/mochitest/test_bug399925.html @@ -0,0 +1,102 @@ + + + + + Test for Bug 399925 + + + + + +Mozilla Bug 399925 +

+ +
+
+
+ + + diff --git a/image/test/mochitest/test_bug415761.html b/image/test/mochitest/test_bug415761.html new file mode 100644 index 0000000000..788e6097b6 --- /dev/null +++ b/image/test/mochitest/test_bug415761.html @@ -0,0 +1,118 @@ + + + + Test for icon filenames + + + + + + +
+
+
+ + + + diff --git a/image/test/mochitest/test_bug435296.html b/image/test/mochitest/test_bug435296.html new file mode 100644 index 0000000000..1610410b16 --- /dev/null +++ b/image/test/mochitest/test_bug435296.html @@ -0,0 +1,85 @@ + + + + + Test for Bug 435296 + + + + + + +Mozilla Bug 435296 + +
+
+
+ + diff --git a/image/test/mochitest/test_bug466586.html b/image/test/mochitest/test_bug466586.html new file mode 100644 index 0000000000..fb900dc2b3 --- /dev/null +++ b/image/test/mochitest/test_bug466586.html @@ -0,0 +1,58 @@ + + + + + Test for Bug 466586 + + + + + +Mozilla Bug 466586 +

+ +
+
+
+ + diff --git a/image/test/mochitest/test_bug468160.html b/image/test/mochitest/test_bug468160.html new file mode 100644 index 0000000000..cb33454e1b --- /dev/null +++ b/image/test/mochitest/test_bug468160.html @@ -0,0 +1,29 @@ + + + + + Test for Bug 468160 + + + + +Mozilla Bug 468160 +

+ +
+
+
+ + diff --git a/image/test/mochitest/test_bug478398.html b/image/test/mochitest/test_bug478398.html new file mode 100644 index 0000000000..45ab6acc2f --- /dev/null +++ b/image/test/mochitest/test_bug478398.html @@ -0,0 +1,87 @@ + + + + + Test for Bug 478398 + + + + + +Mozilla Bug 478398 +
+
+
+ + + diff --git a/image/test/mochitest/test_bug490949.html b/image/test/mochitest/test_bug490949.html new file mode 100644 index 0000000000..8f1b70c8f4 --- /dev/null +++ b/image/test/mochitest/test_bug490949.html @@ -0,0 +1,112 @@ + + + + + Test for Bug 490949 + + + + + +Mozilla Bug 490949 +

+ +
+
+
+ + diff --git a/image/test/mochitest/test_bug496292.html b/image/test/mochitest/test_bug496292.html new file mode 100644 index 0000000000..7f91539bf3 --- /dev/null +++ b/image/test/mochitest/test_bug496292.html @@ -0,0 +1,130 @@ + + + + + Test for Bug 496292 + + + + + +Mozilla Bug 496292 +

+ +
+
+
+ + diff --git a/image/test/mochitest/test_bug497665.html b/image/test/mochitest/test_bug497665.html new file mode 100644 index 0000000000..f14a767b7d --- /dev/null +++ b/image/test/mochitest/test_bug497665.html @@ -0,0 +1,92 @@ + + + + + Test for Bug 497665 + + + + + +Mozilla Bug 497665 +

+
+
+
+
+ + +
+ + diff --git a/image/test/mochitest/test_bug552605-1.html b/image/test/mochitest/test_bug552605-1.html new file mode 100644 index 0000000000..271b3599ce --- /dev/null +++ b/image/test/mochitest/test_bug552605-1.html @@ -0,0 +1,56 @@ + + + + + Test for Bug 552605 + + + + + + +Mozilla Bug 552605 +

+
+
+
+
+ +
+ + diff --git a/image/test/mochitest/test_bug552605-2.html b/image/test/mochitest/test_bug552605-2.html new file mode 100644 index 0000000000..7869a9e481 --- /dev/null +++ b/image/test/mochitest/test_bug552605-2.html @@ -0,0 +1,53 @@ + + + + + Test for Bug 552605 + + + + + + +Mozilla Bug 552605 +

+
+
+
+
+ + +
+ + diff --git a/image/test/mochitest/test_bug553982.html b/image/test/mochitest/test_bug553982.html new file mode 100644 index 0000000000..f7fe58a0af --- /dev/null +++ b/image/test/mochitest/test_bug553982.html @@ -0,0 +1,39 @@ + + + + + Test for Bug 553982 + + + + + +Mozilla Bug 553982 +
+
+
+ + + diff --git a/image/test/mochitest/test_bug601470.html b/image/test/mochitest/test_bug601470.html new file mode 100644 index 0000000000..fdf2d074f8 --- /dev/null +++ b/image/test/mochitest/test_bug601470.html @@ -0,0 +1,45 @@ + + + + + Test for Bug 601470 + + + + +Mozilla Bug 601470 +

+ +
+
+
+ + diff --git a/image/test/mochitest/test_bug614392.html b/image/test/mochitest/test_bug614392.html new file mode 100644 index 0000000000..94585ba35e --- /dev/null +++ b/image/test/mochitest/test_bug614392.html @@ -0,0 +1,42 @@ + + + + + Test for Bug 614392 + + + + +Mozilla Bug 614392 +

+ +
+
+
+ + diff --git a/image/test/mochitest/test_bug657191.html b/image/test/mochitest/test_bug657191.html new file mode 100644 index 0000000000..17fcae6c8a --- /dev/null +++ b/image/test/mochitest/test_bug657191.html @@ -0,0 +1,34 @@ + + + + + Test for Bug 657191 + + + + + +Mozilla Bug 657191 +

+ +
+
+
+ + diff --git a/image/test/mochitest/test_bug671906.html b/image/test/mochitest/test_bug671906.html new file mode 100644 index 0000000000..82f70f19d6 --- /dev/null +++ b/image/test/mochitest/test_bug671906.html @@ -0,0 +1,71 @@ + + + + + Test for Bug 671906 + + + + + + +Mozilla Bug 671906 +

+
+
+
+
+ +
+ + diff --git a/image/test/mochitest/test_bug733553.html b/image/test/mochitest/test_bug733553.html new file mode 100644 index 0000000000..6d7ed81019 --- /dev/null +++ b/image/test/mochitest/test_bug733553.html @@ -0,0 +1,92 @@ + + + + + Test for Bug 733553 + + + + + +Mozilla Bug 733553 +

+
+
+
+
+ +
+ + diff --git a/image/test/mochitest/test_bug767779.html b/image/test/mochitest/test_bug767779.html new file mode 100644 index 0000000000..ae3fe492cf --- /dev/null +++ b/image/test/mochitest/test_bug767779.html @@ -0,0 +1,44 @@ + + + + + Test for Bug 767779 + + + + + + + + +Mozilla Bug 767779 +

+
+
+
+
+
+
+ +
+
+ +
+ + diff --git a/image/test/mochitest/test_bug865919.html b/image/test/mochitest/test_bug865919.html new file mode 100644 index 0000000000..46686c67d7 --- /dev/null +++ b/image/test/mochitest/test_bug865919.html @@ -0,0 +1,53 @@ + + + + + + Test for Bug 865919 + + + + + + + +
+ +
+ + + + diff --git a/image/test/mochitest/test_bug89419-1.html b/image/test/mochitest/test_bug89419-1.html new file mode 100644 index 0000000000..3364dacbfb --- /dev/null +++ b/image/test/mochitest/test_bug89419-1.html @@ -0,0 +1,68 @@ + + + + + Test for Bug 89419 + + + + + + +Mozilla Bug 89419 +

+
+
+
+
+ +
+ + diff --git a/image/test/mochitest/test_bug89419-2.html b/image/test/mochitest/test_bug89419-2.html new file mode 100644 index 0000000000..25861b9179 --- /dev/null +++ b/image/test/mochitest/test_bug89419-2.html @@ -0,0 +1,70 @@ + + + + + Test for Bug 89419 + + + + + + +Mozilla Bug 89419 +

+
+
+
+
+ +
+ + diff --git a/image/test/mochitest/test_bullet_animation.html b/image/test/mochitest/test_bullet_animation.html new file mode 100644 index 0000000000..1d97512fdb --- /dev/null +++ b/image/test/mochitest/test_bullet_animation.html @@ -0,0 +1,56 @@ + + + + + Test for Bug 666446 - Animated Bullets + + + + + + + + +Mozilla Bug 666446: lots of animated gifs swamp us with paint events + +

+ +
+ + + +
+ +
+
+
+
+ + diff --git a/image/test/mochitest/test_canvas_frame_animation.html b/image/test/mochitest/test_canvas_frame_animation.html new file mode 100644 index 0000000000..c2820b3a66 --- /dev/null +++ b/image/test/mochitest/test_canvas_frame_animation.html @@ -0,0 +1,24 @@ + +Test for bug 1619245 - animated image as canvas background + + + + + + + + + + + diff --git a/image/test/mochitest/test_changeOfSource.html b/image/test/mochitest/test_changeOfSource.html new file mode 100644 index 0000000000..f557a3a140 --- /dev/null +++ b/image/test/mochitest/test_changeOfSource.html @@ -0,0 +1,62 @@ + + + + + Test for Bug 666446 - Change of Source (1st Version) + + + + + + + + +Mozilla Bug 666446: lots of animated gifs swamp us with paint events + +

+ +
+
+
+
+ +
+
+ +
+
+
+
+ + diff --git a/image/test/mochitest/test_changeOfSource2.html b/image/test/mochitest/test_changeOfSource2.html new file mode 100644 index 0000000000..e3db345470 --- /dev/null +++ b/image/test/mochitest/test_changeOfSource2.html @@ -0,0 +1,47 @@ + + + + + Test for Bug 691792 - Change of Source (2nd Version) + + + + + + + + +Mozilla Bug 691792: Change of src attribute for animated gifs no longer works as expected + +

+ +
+
+ +
+
+ +
+
+
+
+ + diff --git a/image/test/mochitest/test_discardAnimatedImage.html b/image/test/mochitest/test_discardAnimatedImage.html new file mode 100644 index 0000000000..d74190c78d --- /dev/null +++ b/image/test/mochitest/test_discardAnimatedImage.html @@ -0,0 +1,215 @@ + + + + + Test that animated images can be discarded + + + + + + +Mozilla Bug 686905 +

+
+
+ + + + + + + +
+
+
+
+
+ + + diff --git a/image/test/mochitest/test_discardFinishedAnimatedImage.html b/image/test/mochitest/test_discardFinishedAnimatedImage.html new file mode 100644 index 0000000000..ebaa89e705 --- /dev/null +++ b/image/test/mochitest/test_discardFinishedAnimatedImage.html @@ -0,0 +1,144 @@ + + + + Test that img.decode works on finished, discarded animated images + + + + + + +Mozilla Bug 1629490 +
+ +
+ + + diff --git a/image/test/mochitest/test_discardFramesAnimatedImage.html b/image/test/mochitest/test_discardFramesAnimatedImage.html new file mode 100644 index 0000000000..2e95e6203b --- /dev/null +++ b/image/test/mochitest/test_discardFramesAnimatedImage.html @@ -0,0 +1,268 @@ + + + + + Test that animated images can discard frames and redecode + + + + + + +Mozilla Bug 523950 +

+
+
+ + +
+
+
+
+
+ + + diff --git a/image/test/mochitest/test_drawDiscardedImage.html b/image/test/mochitest/test_drawDiscardedImage.html new file mode 100644 index 0000000000..f1a2dde89c --- /dev/null +++ b/image/test/mochitest/test_drawDiscardedImage.html @@ -0,0 +1,85 @@ + + + + + Test for Bug 731419 - Draw an ostensibly discarded image to a canvas + + + + + + + + + + + + + + + + + diff --git a/image/test/mochitest/test_error_events.html b/image/test/mochitest/test_error_events.html new file mode 100644 index 0000000000..89ed9da528 --- /dev/null +++ b/image/test/mochitest/test_error_events.html @@ -0,0 +1,67 @@ + + + + + Test for Bug 715308 comment 93 + + + + + + + + + +
+ + +
+ + + + + diff --git a/image/test/mochitest/test_has_transparency.html b/image/test/mochitest/test_has_transparency.html new file mode 100644 index 0000000000..6461034635 --- /dev/null +++ b/image/test/mochitest/test_has_transparency.html @@ -0,0 +1,169 @@ + + + + + Test for Bug 1089880 + + + + + + +Mozilla Bug 1089880 +

+
+
+
+
+
+ + diff --git a/image/test/mochitest/test_image_crossorigin_data_url.html b/image/test/mochitest/test_image_crossorigin_data_url.html new file mode 100644 index 0000000000..4465b5aab4 --- /dev/null +++ b/image/test/mochitest/test_image_crossorigin_data_url.html @@ -0,0 +1,28 @@ + + +Test for handling of 'crossorigin' attribute on CSS link with data: URL + + +
+
+ + diff --git a/image/test/mochitest/test_mq_dynamic_svg.html b/image/test/mochitest/test_mq_dynamic_svg.html new file mode 100644 index 0000000000..70f613fcc5 --- /dev/null +++ b/image/test/mochitest/test_mq_dynamic_svg.html @@ -0,0 +1,36 @@ + + +Dynamic changes to prefers-color-scheme affecting SVG images + + + + + + + diff --git a/image/test/mochitest/test_net_failedtoprocess.html b/image/test/mochitest/test_net_failedtoprocess.html new file mode 100644 index 0000000000..470f3f5b31 --- /dev/null +++ b/image/test/mochitest/test_net_failedtoprocess.html @@ -0,0 +1,52 @@ + + + + + Test for image net:failed-to-process-uri-content + + + + +

+
+
+ + + diff --git a/image/test/mochitest/test_removal_ondecode.html b/image/test/mochitest/test_removal_ondecode.html new file mode 100644 index 0000000000..4ce7555757 --- /dev/null +++ b/image/test/mochitest/test_removal_ondecode.html @@ -0,0 +1,160 @@ + + + + + Test for Bug 841579 + + + + + + +Mozilla Bug 841579 +

+
+
+
+
+
+ + diff --git a/image/test/mochitest/test_removal_onload.html b/image/test/mochitest/test_removal_onload.html new file mode 100644 index 0000000000..0a060542f5 --- /dev/null +++ b/image/test/mochitest/test_removal_onload.html @@ -0,0 +1,142 @@ + + + + + Test for Bug 841579 + + + + + + +Mozilla Bug 841579 +

+
+
+
+
+
+ + diff --git a/image/test/mochitest/test_short_gif_header.html b/image/test/mochitest/test_short_gif_header.html new file mode 100644 index 0000000000..f8294825b5 --- /dev/null +++ b/image/test/mochitest/test_short_gif_header.html @@ -0,0 +1,35 @@ + + + + + Test for Bug 844684 + + + + + +Mozilla Bug 844684 +
+ +
+
+
+
+ + diff --git a/image/test/mochitest/test_staticClone.html b/image/test/mochitest/test_staticClone.html new file mode 100644 index 0000000000..7400e064c6 --- /dev/null +++ b/image/test/mochitest/test_staticClone.html @@ -0,0 +1,41 @@ + + + + + Test for Bug 878037 + + + + +Mozilla Bug 878037 +

+
+ + +
+
+
+
+ + diff --git a/image/test/mochitest/test_svg_animatedGIF.html b/image/test/mochitest/test_svg_animatedGIF.html new file mode 100644 index 0000000000..04077676b7 --- /dev/null +++ b/image/test/mochitest/test_svg_animatedGIF.html @@ -0,0 +1,53 @@ + + + + + Test for Bug 666446 - Animated Raster Images inside of SVG Frames + + + + + + + + + + +

+
+
+ + +
+ +
+
+
+ + diff --git a/image/test/mochitest/test_svg_filter_animation.html b/image/test/mochitest/test_svg_filter_animation.html new file mode 100644 index 0000000000..b72aaa68c1 --- /dev/null +++ b/image/test/mochitest/test_svg_filter_animation.html @@ -0,0 +1,42 @@ + + + + + Test for Bug 666446 - Animated Images within SVG Filters + + + + + + + + +Mozilla Bug 666446: lots of animated gifs swamp us with paint events + +

+
+ + +
+ +
+
+
+ + diff --git a/image/test/mochitest/test_synchronized_animation.html b/image/test/mochitest/test_synchronized_animation.html new file mode 100644 index 0000000000..3c2a874be1 --- /dev/null +++ b/image/test/mochitest/test_synchronized_animation.html @@ -0,0 +1,128 @@ + + + + + Test for Bug 867758 + + + + + + +Mozilla Bug 867758 +

+
+
+
+
+
+ + diff --git a/image/test/mochitest/test_undisplayed_iframe.html b/image/test/mochitest/test_undisplayed_iframe.html new file mode 100644 index 0000000000..695e4e5448 --- /dev/null +++ b/image/test/mochitest/test_undisplayed_iframe.html @@ -0,0 +1,47 @@ + + + + +Test for Bug 666446 - Test for Animated Gif within IFRAME + + + + + + + + + Mozilla Bug 666446: lots of animated gifs swamp us with paint events +

+ +
+ +
+ +
+ +
+
+
+
+ + diff --git a/image/test/mochitest/test_webcam.html b/image/test/mochitest/test_webcam.html new file mode 100644 index 0000000000..8d6bf6b490 --- /dev/null +++ b/image/test/mochitest/test_webcam.html @@ -0,0 +1,68 @@ + + + + + Test for Bug 641748 - WebCam Simulacrum + + + + + + + + +Mozilla Bug 641748: GIF decoder doesn't support multipart/x-mixed-replace + +

+ +
+
+
+ +
+
+ +
+
+
+
+ + diff --git a/image/test/mochitest/test_xultree_animation.xhtml b/image/test/mochitest/test_xultree_animation.xhtml new file mode 100644 index 0000000000..71610c97ef --- /dev/null +++ b/image/test/mochitest/test_xultree_animation.xhtml @@ -0,0 +1,67 @@ + + + + + Test for Bug 666446 - Animated Images within SVG Filters + + + + + + + + +Mozilla Bug 666446: lots of animated gifs swamp us with paint events + +

+
+ + +
+ + + + + + + + + + + + +
+ +
+
+
+ + diff --git a/image/test/mochitest/transparent.gif b/image/test/mochitest/transparent.gif new file mode 100644 index 0000000000..48f5c7caf1 Binary files /dev/null and b/image/test/mochitest/transparent.gif differ diff --git a/image/test/mochitest/transparent.png b/image/test/mochitest/transparent.png new file mode 100644 index 0000000000..fc8002053a Binary files /dev/null and b/image/test/mochitest/transparent.png differ diff --git a/image/test/mochitest/webcam-simulacrum.sjs b/image/test/mochitest/webcam-simulacrum.sjs new file mode 100644 index 0000000000..23872e675e --- /dev/null +++ b/image/test/mochitest/webcam-simulacrum.sjs @@ -0,0 +1,51 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ + */ + +var counter = 2; +var frames = ['red.gif', 'blue.gif']; +var timer = Components.classes["@mozilla.org/timer;1"]; +var partTimer = timer.createInstance(Components.interfaces.nsITimer); + +function getFileAsInputStream(aFilename) { + var file = Components.classes["@mozilla.org/file/directory_service;1"] + .getService(Components.interfaces.nsIProperties) + .get("CurWorkD", Components.interfaces.nsIFile); + + file.append("tests"); + file.append("image"); + file.append("test"); + file.append("mochitest"); + file.append(aFilename); + + var fileStream = Components.classes['@mozilla.org/network/file-input-stream;1'] + .createInstance(Components.interfaces.nsIFileInputStream); + fileStream.init(file, 1, 0, false); + return fileStream; +} + +function handleRequest(request, response) +{ + response.setHeader("Content-Type", + "multipart/x-mixed-replace;boundary=BOUNDARYOMG", false); + response.setHeader("Cache-Control", "no-cache", false); + response.setStatusLine(request.httpVersion, 200, "OK"); + response.processAsync(); + response.write("--BOUNDARYOMG\r\n"); + while (frames.length > 0) { + sendNextPart(response); + } + response.write("--BOUNDARYOMG--\r\n"); + response.finish(); +} + +function sendNextPart(response) { + var nextPartHead = "Content-Type: image/gif\r\n\r\n"; + var inputStream = getFileAsInputStream(frames.shift()); + response.bodyOutputStream.write(nextPartHead, nextPartHead.length); + response.bodyOutputStream.writeFrom(inputStream, inputStream.available()); + inputStream.close(); + // Toss in the boundary, so the browser can know this part is complete + response.write("--BOUNDARYOMG\r\n"); +} + -- cgit v1.2.3