mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-23 02:05:42 +00:00
0d460e3432
This is split from the previous changeset since if we include dom/ the file size is too large for phabricator to handle. This is an autogenerated commit to handle scripts loading mochitest harness files, in the simple case where the script src is on the same line as the tag. This was generated with https://bug1544322.bmoattachments.org/attachment.cgi?id=9058170 using the `--part 2` argument. Differential Revision: https://phabricator.services.mozilla.com/D27457 --HG-- extra : moz-landing-system : lando
48 lines
1.3 KiB
HTML
48 lines
1.3 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<title>Test that capturing a stream doesn't stop the underlying element from firing events</title>
|
|
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
|
<script type="text/javascript" src="manifest.js"></script>
|
|
</head>
|
|
<body>
|
|
<audio id="a"></audio>
|
|
<pre id="test">
|
|
<script class="testbody" type="text/javascript">
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
var a = document.getElementById('a');
|
|
var validTimeUpdate = false;
|
|
|
|
function startTest() {
|
|
a.src = "big.wav";
|
|
var context = new AudioContext();
|
|
var node = context.createMediaElementSource(a);
|
|
node.connect(context.destination);
|
|
a.addEventListener("timeupdate", function() {
|
|
if (a.currentTime > 0.0 && a.currentTime < 5.0 && !validTimeUpdate) {
|
|
validTimeUpdate = true;
|
|
ok(true, "Received reasonable currentTime in a timeupdate");
|
|
SimpleTest.finish();
|
|
}
|
|
});
|
|
a.addEventListener("ended", function() {
|
|
if (!validTimeUpdate) {
|
|
ok(false, "Received reasonable currentTime in a timeupdate");
|
|
SimpleTest.finish();
|
|
}
|
|
});
|
|
a.play();
|
|
}
|
|
|
|
if (a.canPlayType("audio/wave")) {
|
|
startTest();
|
|
} else {
|
|
todo(false, "No playable audio");
|
|
}
|
|
</script>
|
|
</pre>
|
|
</body>
|
|
</html>
|