Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Unified Diff: LayoutTests/http/tests/media/video-in-iframe-crash.html

Issue 25362002: Block load event dispatching on old document when an HTMLMediaElement is moved between documents. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase and move reloadPage() call so the test is more deterministic. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/http/tests/media/video-in-iframe-crash-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/media/video-in-iframe-crash.html
diff --git a/LayoutTests/http/tests/media/video-in-iframe-crash.html b/LayoutTests/http/tests/media/video-in-iframe-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..41e69cfa514417310ae3513a629a4176443c069a
--- /dev/null
+++ b/LayoutTests/http/tests/media/video-in-iframe-crash.html
@@ -0,0 +1,62 @@
+<!doctype html>
+<html>
+ <script src="../../media-resources/video-test.js"></script>
+ <script>
+ function getNextURL()
+ {
+ var url = location.href;
+ var queryIndex = url.indexOf("?");
+ var loadCount = 1;
+ if (queryIndex >= 0) {
+ loadCount = parseInt(url.substring(queryIndex + 1));
+
+ // Enforce an arbitrary reload limit that is high enough to trigger previosly observed crashes.
+ if (loadCount >= 10)
+ return "";
+
+ url = url.substring(0, queryIndex);
+ }
+
+ return url + "?" + (loadCount + 1);
+ }
+
+ function reloadPage()
+ {
+ var url = getNextURL();
+ if (url.length == 0) {
+ endTest();
+ return;
+ }
+ location.href = url;
+ }
+
+ function start()
+ {
+ iframe = document.createElement("iframe");
+ iframe.src = "../../media-resources/resources/frame_size_change.webm";
+ document.getElementById("store_div").appendChild(iframe);
+ window.setTimeout(moveIframeBodyIntoDocumentBody, 20);
+ }
+
+ function moveIframeBodyIntoDocumentBody()
+ {
+ var iframeContentDocument = iframe.contentDocument;
+ var iframeDocumentElement = iframeContentDocument.documentElement;
+
+ iframeContentDocument.onreadystatechange = function(e)
+ {
+ // Attempts to move the document body back into the iframe document.
+ iframeDocumentElement.innerHTML = document.documentElement;
+ }
+
+ // Moves the iframe body into the current document.
+ document.body.appendChild(iframeContentDocument.firstChild);
+ reloadPage();
+ }
+
+ </script>
+ <body onload="start()">
+ <p>Tests that moving a &lt;video&gt; in and out of an iframe does not trigger a crash.</p>
+ <div id="store_div"></div>
+ </body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/http/tests/media/video-in-iframe-crash-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698