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

Side by Side Diff: third_party/WebKit/LayoutTests/media/track/media-element-enqueue-event-crash.html

Issue 2078443003: Convert media-element*, track-cue* and track-remove* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use "onenter" event attribute Created 4 years, 6 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/track/media-element-enqueue-event-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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <title>Tests that appending events for dispatching doesn't crash.</title>
3 <head> 3 <script src="../../resources/testharness.js"></script>
4 <script src=../media-file.js></script> 4 <script src="../../resources/testharnessreport.js"></script>
5 <script src=../media-controls.js></script> 5 <script src="../../resources/gc.js"></script>
6 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 6 <script src="../media-file.js"></script>
7 (Please avoid writing new tests using video-test.js) --> 7 <video autoplay>
8 <script src=../video-test.js></script> 8 <track src="captions-webvtt/captions-fast.vtt" default>
9 </video>
10 <script>
11 async_test(function(t) {
12 if (localStorage.testRuns)
13 localStorage.testRuns = Number(localStorage.testRuns) + 1;
14 else {
15 localStorage.testRuns = 1;
16 localStorage.totalRuns = 5;
17 }
9 18
10 <script> 19 document.querySelector("track").track.mode = "showing";
11 if (window.testRunner) 20 setTimeout(t.step_func(CFcrash), 100);
12 {
13 testRunner.dumpAsText();
14 testRunner.waitUntilDone();
15 }
16 21
17 function startTest() 22 function CFcrash() {
18 { 23 var video = document.querySelector("video");
19 if (localStorage.testRuns) 24 video.src = findMediaFile("video", "content/test");
20 localStorage.testRuns = Number(localStorage.testRuns) + 1; 25 var document1 = document.implementation.createDocument("", null);
21 else { 26 document1.appendChild(video);
22 localStorage.testRuns = 1; 27 delete document1;
23 localStorage.totalRuns = 5;
24 }
25 28
26 document.getElementsByTagName('track')[0].track.mode = 'showing'; 29 setTimeout(t.step_func(forceGC), 0);
27 setTimeout(CFcrash, 100); 30 }
28 }
29 31
30 function forceGC() { 32 function forceGC() {
31 gc(); 33 gc();
32 34
33 // End the test only if it ran at least totalRuns. 35 // End the test only if it ran totalRuns.
34 if (window.testRunner && localStorage.testRuns == localStorage.total Runs) { 36 if (localStorage.testRuns == localStorage.totalRuns)
35 consoleWrite("** No crash. Pass **"); 37 t.done();
36 testRunner.notifyDone(); 38 else
37 } else 39 location.reload();
38 window.location.reload(); 40 }
39 }
40 41
41 function CFcrash() 42 });
42 { 43 </script>
43 document1 = document.implementation.createDocument("", null);
44 document1.appendChild(videoElement);
45 delete document1;
46
47 setTimeout(forceGC, 0);
48 }
49
50 document.addEventListener("DOMContentLoaded", startTest, false);
51 </script>
52 </head>
53
54 <body>
55 <p>Tests that appending events for dispatching doesn't crash</p>
56 <video autoplay id="videoElement">
57 <source src="../content/test.ogv">
58 <source src="../content/test.mp4">
59 <track src="captions-webvtt/captions-fast.vtt" default>
60 </video>
61 </body>
62 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/track/media-element-enqueue-event-crash-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698