blob: 4cf555019547b7291d5ac8f2ad9ebd85d9ec7e23 [file] [log] [blame]
<!doctype html>
<html>
<head>
<title>video events - loadedmetadata, then loadeddata</title>
<script src="../../w3cwrapper.js"></script>
<script src="../../../Microsoft/common/media.js"></script>
</head>
<body>
<p><a href="http://dev.w3.org/html5/spec/Overview.html#mediaevents">spec reference</a></p>
<video id="a" autoplay controls>
</video>
<div id="log"></div>
<script>
var t = async_test("setting src attribute on autoplay video should trigger loadedmetadata then loadeddata event", {timeout:30000});
var a = document.getElementById("a");
var found_loadedmetadata = false;
a.addEventListener("loadedmetadata", function() {
found_loadedmetadata = true;
});
a.addEventListener("loadeddata", function() {
t.step(function() {
assert_true(found_loadedmetadata);
});
t.done();
a.pause();
});
a.src = getAudioURI("http://media.w3.org/2010/05/sound/sound_5") + "?" + new Date() + Math.random();
</script>
</body>
</html>