content/media/test/test_texttracklist.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=882703
     5 -->
     6 <head>
     7   <meta charset="utf-8">
     8   <title>Media test: TextTrackList change event</title>
     9   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    10   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    11   <script type="application/javascript">
    13   SimpleTest.waitForExplicitFinish();
    14   video = document.createElement("video");
    16   isnot(video.textTracks, null, "Video should have a list of TextTracks.");
    18   video.addTextTrack("subtitles", "", "");
    20   track = video.textTracks[0];
    21   video.textTracks.addEventListener("change", changed);
    23   is(track.mode, "hidden", "New TextTrack's mode should be hidden.");
    24   track.mode = "showing";
    26   function changed(event) {
    27     is(event.target, video.textTracks, "change event's target should be video.textTracks.");
    28     ok(event instanceof window.Event, "change event should be a simple event.");
    29     ok(!event.bubbles, "change event should not bubble.");
    30     ok(event.isTrusted, "change event should be trusted.");
    31     ok(!event.cancelable, "change event should not be cancelable.");
    33     SimpleTest.finish();
    34   }
    35   </script>
    36 </head>
    37 <body>
    38 </body>
    39 </html>

mercurial