1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/media/test/test_error_in_video_document.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,57 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=604067 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 604067</title> 1.11 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.12 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.13 + <script type="text/javascript" src="manifest.js"></script> 1.14 +</head> 1.15 +<body> 1.16 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=604067">Mozilla Bug 604067</a> 1.17 + 1.18 +<p id="display"></p> 1.19 +<div id="content" style="display: none"> 1.20 + 1.21 +</div> 1.22 +<pre id="test"> 1.23 +<script type="application/javascript"> 1.24 + 1.25 +/** Test for Bug 604067 **/ 1.26 + 1.27 +function check() { 1.28 + var v = document.body.getElementsByTagName("iframe")[0] 1.29 + .contentDocument.body.getElementsByTagName("video")[0]; 1.30 + 1.31 + // Debug info for Bug 608634 1.32 + ok(true, "iframe src=" + document.body.getElementsByTagName("iframe")[0].src); 1.33 + is(v.readyState, 0, "Ready state"); 1.34 + 1.35 + is(v.networkState, 0, "Network state"); 1.36 + isnot(v.error, null, "Error object"); 1.37 + if (v.error) 1.38 + is(v.error.code, MediaError.MEDIA_ERR_DECODE, "Error code"); 1.39 + 1.40 + SimpleTest.finish(); 1.41 +} 1.42 + 1.43 +// Find an error test that we'd think we should be able to play (if it 1.44 +// wasn't already known to fail). 1.45 +var t = getPlayableVideo(gErrorTests); 1.46 +if (!t) { 1.47 + todo(false, "No types supported"); 1.48 +} else { 1.49 + SimpleTest.waitForExplicitFinish(); 1.50 + 1.51 + var f = document.createElement("iframe"); 1.52 + f.src = t.name; 1.53 + f.addEventListener("load", function() { SimpleTest.executeSoon(check); }, false); 1.54 + document.body.appendChild(f); 1.55 +} 1.56 + 1.57 +</script> 1.58 +</pre> 1.59 +</body> 1.60 +</html>