44 lines
1.0 KiB
HTML
44 lines
1.0 KiB
HTML
<!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>
|