-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sync
media-element-enqueue-event-crash.html
from Blink / Chromium u…
…pstream https://bugs.webkit.org/show_bug.cgi?id=270410 Reviewed by Jean-Yves Avenard. This patch is to sync `media-element-enqueue-event-crash.html` from Blink / Chromium upstream as per below latest commit: Only change is to use `mp4` rather than `ogv`. Partial Merge: https://source.chromium.org/chromium/chromium/src/+/2e0d99c0e86f5dc6624817f27ba76884f5cbbf83 * LayoutTests/media/track/media-element-enqueue-event-crash.html: Updated * LayoutTests/media/track/media-element-enqueue-event-crash-expected.txt: Ditto Canonical link: https://commits.webkit.org/275654@main
- Loading branch information
1 parent
5e99c9e
commit e651241
Showing
2 changed files
with
42 additions
and
61 deletions.
There are no files selected for viewing
3 changes: 1 addition & 2 deletions
3
LayoutTests/media/track/media-element-enqueue-event-crash-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
Tests that appending events for dispatching doesn't crash | ||
|
||
** No crash. Pass ** | ||
PASS Tests that appending events for dispatching doesn't crash. | ||
|
100 changes: 41 additions & 59 deletions
100
LayoutTests/media/track/media-element-enqueue-event-crash.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,42 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script src=../video-test.js></script> | ||
<script src=../../resources/gc.js></script> | ||
|
||
<script> | ||
if (window.testRunner) | ||
{ | ||
testRunner.dumpAsText(); | ||
testRunner.waitUntilDone(); | ||
} | ||
|
||
function startTest() | ||
{ | ||
if (localStorage.testRuns) | ||
localStorage.testRuns = Number(localStorage.testRuns) + 1; | ||
else { | ||
localStorage.testRuns = 1; | ||
localStorage.totalRuns = 2; | ||
} | ||
|
||
document.getElementsByTagName('track')[0].track.mode = 'showing'; | ||
setTimeout(CFcrash, 100); | ||
} | ||
|
||
function forceGC() { | ||
gc(); | ||
|
||
// End the test only if it ran at least totalRuns. | ||
if (window.testRunner && localStorage.testRuns == localStorage.totalRuns) { | ||
consoleWrite("** No crash. Pass **"); | ||
testRunner.notifyDone(); | ||
} else | ||
window.location.reload(); | ||
} | ||
|
||
function CFcrash() | ||
{ | ||
document1 = document.implementation.createDocument("", null); | ||
document1.appendChild(videoElement); | ||
delete document1; | ||
|
||
setTimeout(forceGC, 0); | ||
} | ||
|
||
document.addEventListener("DOMContentLoaded", startTest, false); | ||
setCaptionDisplayMode('Automatic'); | ||
</script> | ||
</head> | ||
|
||
<body> | ||
<p>Tests that appending events for dispatching doesn't crash</p> | ||
<video autoplay id="videoElement"> | ||
<source src="../content/test.ogv"> | ||
<source src="../content/test.mp4"> | ||
<track src="captions-webvtt/captions-fast.vtt" default> | ||
</video> | ||
</body> | ||
</html> | ||
<title>Tests that appending events for dispatching doesn't crash.</title> | ||
<script src="../../resources/testharness.js"></script> | ||
<script src="../../resources/testharnessreport.js"></script> | ||
<script src="../../resources/gc.js"></script> | ||
<video autoplay> | ||
<track src="captions-webvtt/captions-fast.vtt" default> | ||
</video> | ||
<script> | ||
async_test(function(t) { | ||
if (localStorage.testRuns) | ||
localStorage.testRuns = Number(localStorage.testRuns) + 1; | ||
else { | ||
localStorage.testRuns = 1; | ||
localStorage.totalRuns = 5; | ||
} | ||
|
||
document.querySelector("track").track.mode = "showing"; | ||
setTimeout(t.step_func(CFcrash), 100); | ||
|
||
function CFcrash() { | ||
var video = document.querySelector("video"); | ||
video.src = "content/test.mp4"; | ||
var document1 = document.implementation.createDocument("", null); | ||
document1.appendChild(video); | ||
delete document1; | ||
|
||
setTimeout(t.step_func(forceGC), 0); | ||
} | ||
|
||
function forceGC() { | ||
gc(); | ||
|
||
// End the test only if it ran totalRuns. | ||
if (localStorage.testRuns == localStorage.totalRuns) | ||
t.done(); | ||
else | ||
location.reload(); | ||
} | ||
|
||
}); | ||
</script> |