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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/http/tests/media/video-in-iframe-crash-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!doctype html>
2 <html>
3 <script src="../../media-resources/video-test.js"></script>
4 <script>
5 function getNextURL()
6 {
7 var url = location.href;
8 var queryIndex = url.indexOf("?");
9 var loadCount = 1;
10 if (queryIndex >= 0) {
11 loadCount = parseInt(url.substring(queryIndex + 1));
12
13 // Enforce an arbitrary reload limit that is high enough to trigge r previosly observed crashes.
14 if (loadCount >= 10)
15 return "";
16
17 url = url.substring(0, queryIndex);
18 }
19
20 return url + "?" + (loadCount + 1);
21 }
22
23 function reloadPage()
24 {
25 var url = getNextURL();
26 if (url.length == 0) {
27 endTest();
28 return;
29 }
30 location.href = url;
31 }
32
33 function start()
34 {
35 iframe = document.createElement("iframe");
36 iframe.src = "../../media-resources/resources/frame_size_change.webm ";
37 document.getElementById("store_div").appendChild(iframe);
38 window.setTimeout(moveIframeBodyIntoDocumentBody, 20);
39 }
40
41 function moveIframeBodyIntoDocumentBody()
42 {
43 var iframeContentDocument = iframe.contentDocument;
44 var iframeDocumentElement = iframeContentDocument.documentElement;
45
46 iframeContentDocument.onreadystatechange = function(e)
47 {
48 // Attempts to move the document body back into the iframe docum ent.
49 iframeDocumentElement.innerHTML = document.documentElement;
50 }
51
52 // Moves the iframe body into the current document.
53 document.body.appendChild(iframeContentDocument.firstChild);
54 reloadPage();
55 }
56
57 </script>
58 <body onload="start()">
59 <p>Tests that moving a &lt;video&gt; in and out of an iframe does not tr igger a crash.</p>
60 <div id="store_div"></div>
61 </body>
62 </html>
OLDNEW
« 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