blob: c6bfe7c7608e68bf5d6d7e95f395da4131d3fd78 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body onload="runTest()">
<script>
description("Test that animated images are properly stopped / resumed on window resizing.");
jsTestIsAsync = true;
var testWindow;
function isImagePaused()
{
return internals.hasPausedImageAnimations(testWindow.document.getElementById("testImage"));
}
function enlargeWindow()
{
debug("Resize window so that the image is now inside the viewport.");
testWindow.resizeTo(500, 500);
shouldBecomeEqual("isImagePaused()", "false", finishJSTest);
}
function windowLoaded()
{
debug("The animated GIF should initially be outside the viewport.");
shouldBecomeEqual("isImagePaused()", "true", enlargeWindow);
}
function runTest()
{
if (window.testRunner)
testRunner.setCanOpenWindows();
testWindow = window.open("resources/animated-gif-window-resize.html", "testWindow", "width=200, height=200");
testWindow.onload = windowLoaded;
}
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>