content/media/test/test_error_in_video_document.html

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=604067
     5 -->
     6 <head>
     7   <title>Test for Bug 604067</title>
     8   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    10   <script type="text/javascript" src="manifest.js"></script>
    11 </head>
    12 <body>
    13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=604067">Mozilla Bug 604067</a>
    15 <p id="display"></p>
    16 <div id="content" style="display: none">
    18 </div>
    19 <pre id="test">
    20 <script type="application/javascript">
    22 /** Test for Bug 604067 **/
    24 function check() {
    25   var v = document.body.getElementsByTagName("iframe")[0]
    26                   .contentDocument.body.getElementsByTagName("video")[0];
    28   // Debug info for Bug 608634
    29   ok(true, "iframe src=" + document.body.getElementsByTagName("iframe")[0].src);
    30   is(v.readyState, 0, "Ready state");
    32   is(v.networkState, 0, "Network state");
    33   isnot(v.error, null, "Error object");
    34   if (v.error)
    35     is(v.error.code, MediaError.MEDIA_ERR_DECODE, "Error code");
    37   SimpleTest.finish();
    38 }
    40 // Find an error test that we'd think we should be able to play (if it
    41 // wasn't already known to fail).
    42 var t = getPlayableVideo(gErrorTests);
    43 if (!t) {
    44   todo(false, "No types supported");
    45 } else {
    46   SimpleTest.waitForExplicitFinish();
    48   var f = document.createElement("iframe");
    49   f.src = t.name;
    50   f.addEventListener("load", function() { SimpleTest.executeSoon(check); }, false);
    51   document.body.appendChild(f);
    52 }
    54 </script>
    55 </pre>
    56 </body>
    57 </html>

mercurial