Fri, 16 Jan 2015 04:50:19 +0100
Replace accessor implementation with direct member state manipulation, by
request https://trac.torproject.org/projects/tor/ticket/9701#comment:32
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <!-- |
michael@0 | 4 | https://bugzilla.mozilla.org/show_bug.cgi?id=882703 |
michael@0 | 5 | --> |
michael@0 | 6 | <head> |
michael@0 | 7 | <meta charset="utf-8"> |
michael@0 | 8 | <title>Media test: TextTrackList change event</title> |
michael@0 | 9 | <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 10 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
michael@0 | 11 | <script type="application/javascript"> |
michael@0 | 12 | |
michael@0 | 13 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 14 | video = document.createElement("video"); |
michael@0 | 15 | |
michael@0 | 16 | isnot(video.textTracks, null, "Video should have a list of TextTracks."); |
michael@0 | 17 | |
michael@0 | 18 | video.addTextTrack("subtitles", "", ""); |
michael@0 | 19 | |
michael@0 | 20 | track = video.textTracks[0]; |
michael@0 | 21 | video.textTracks.addEventListener("change", changed); |
michael@0 | 22 | |
michael@0 | 23 | is(track.mode, "hidden", "New TextTrack's mode should be hidden."); |
michael@0 | 24 | track.mode = "showing"; |
michael@0 | 25 | |
michael@0 | 26 | function changed(event) { |
michael@0 | 27 | is(event.target, video.textTracks, "change event's target should be video.textTracks."); |
michael@0 | 28 | ok(event instanceof window.Event, "change event should be a simple event."); |
michael@0 | 29 | ok(!event.bubbles, "change event should not bubble."); |
michael@0 | 30 | ok(event.isTrusted, "change event should be trusted."); |
michael@0 | 31 | ok(!event.cancelable, "change event should not be cancelable."); |
michael@0 | 32 | |
michael@0 | 33 | SimpleTest.finish(); |
michael@0 | 34 | } |
michael@0 | 35 | </script> |
michael@0 | 36 | </head> |
michael@0 | 37 | <body> |
michael@0 | 38 | </body> |
michael@0 | 39 | </html> |