| <script src="../../resources/js-test-pre.js"></script> |
| description("Tests that animated SVG images are properly paused when loaded in a new iframe inside a hidden page"); |
| function frameLoadedInBackground() |
| testImage = frame.contentDocument.getElementById("testImage"); |
| shouldBecomeEqual("internals.isImageAnimating(testImage)", "false", function() { |
| document.onvisibilitychange = null; |
| debug("Setting page visibility to visible"); |
| testRunner.setPageVisibility('visible'); |
| shouldBecomeEqual("internals.isImageAnimating(testImage)", "true", finishJSTest); |
| window.onload = function() { |
| document.onvisibilitychange = function() { |
| shouldBeTrue("document.hidden"); |
| frame = document.createElement("iframe"); |
| frame.src = "resources/iframe-with-animated-svg-image.html"; |
| frame.onload = frameLoadedInBackground; |
| document.body.appendChild(frame); |
| debug("Setting page visibility to hidden"); |
| testRunner.setPageVisibility('hidden'); |
| <script src="../../resources/js-test-post.js"></script> |