| <script src="../../resources/js-test-pre.js"></script> |
| <body onload="runTest()"> |
| <div style="position: relative; width: 1600px; height: 2400px; background-color: green;"> |
| <div style="position:absolute; left: 600px; top: 800px;"><img src="resources/animated.gif" id="testImage"/></div> |
| description("Make sure that animated images are properly stopped / resumed when zooming in or out."); |
| function isImageAnimated() |
| return !internals.hasPausedImageAnimations(document.getElementById("testImage")); |
| debug("Zoom in so that the image is no longer visible."); |
| for (var i = 0; i < 5; ++i) |
| window.eventSender.zoomPageIn(); |
| shouldBecomeEqual("isImageAnimated()", "false", finishJSTest); |
| debug("Zoom out so that the image becomes visible."); |
| for (var i = 0; i < 5; ++i) |
| window.eventSender.zoomPageOut(); |
| shouldBecomeEqual("isImageAnimated()", "true", zoomIn); |
| shouldBecomeEqual("isImageAnimated()", "false", zoomOut); |
| // Make sure the image is loaded before we check if it is animated. |
| img.onload = imageLoaded; |
| img.src = "resources/animated.gif"; |
| <script src="../../resources/js-test-post.js"></script> |