accessible/tests/mochitest/actions/test_media.html

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

michael@0 1 <!DOCTYPE html>
michael@0 2 <html>
michael@0 3 <!--
michael@0 4 https://bugzilla.mozilla.org/show_bug.cgi?id=483573
michael@0 5 -->
michael@0 6 <head>
michael@0 7 <title>HTML5 audio/video tests</title>
michael@0 8 <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
michael@0 9
michael@0 10 <script type="application/javascript"
michael@0 11 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
michael@0 12
michael@0 13 <script type="application/javascript"
michael@0 14 src="../common.js"></script>
michael@0 15 <script type="application/javascript"
michael@0 16 src="../events.js"></script>
michael@0 17 <script type="application/javascript"
michael@0 18 src="../actions.js"></script>
michael@0 19 <script type="application/javascript"
michael@0 20 src="../role.js"></script>
michael@0 21 <script type="application/javascript"
michael@0 22 src="../states.js"></script>
michael@0 23
michael@0 24 <script type="application/javascript">
michael@0 25
michael@0 26 // gA11yEventDumpID = "eventDump";
michael@0 27 //gA11yEventDumpToConsole = true; // debug stuff
michael@0 28
michael@0 29 function focusChecker(aAcc)
michael@0 30 {
michael@0 31 this.type = EVENT_FOCUS;
michael@0 32 this.target = aAcc;
michael@0 33 this.getID = function focusChecker_getID()
michael@0 34 {
michael@0 35 return "focus handling";
michael@0 36 }
michael@0 37 this.check = function focusChecker_check(aEvent)
michael@0 38 {
michael@0 39 testStates(this.target, STATE_FOCUSED);
michael@0 40 }
michael@0 41 }
michael@0 42
michael@0 43 function nameChecker(aAcc, aName)
michael@0 44 {
michael@0 45 this.type = EVENT_NAME_CHANGE;
michael@0 46 this.target = aAcc;
michael@0 47 this.getID = function nameChecker_getID()
michael@0 48 {
michael@0 49 return "name change handling";
michael@0 50 },
michael@0 51 this.check = function nameChecker_check(aEvent)
michael@0 52 {
michael@0 53 is(aEvent.accessible.name, aName,
michael@0 54 "Wrong name of " + prettyName(aEvent.accessible) + " on focus");
michael@0 55 }
michael@0 56 }
michael@0 57
michael@0 58 function doTest()
michael@0 59 {
michael@0 60 //////////////////////////////////////////////////////////////////////////
michael@0 61 // test actions of audio controls
michael@0 62
michael@0 63 todo(false, "Focus test are disabled until bug 494175 is fixed.");
michael@0 64
michael@0 65 var audioElm = getAccessible("audio");
michael@0 66 var playBtn = audioElm.firstChild;
michael@0 67 var scrubber = playBtn.nextSibling.nextSibling.nextSibling;
michael@0 68 var muteBtn = audioElm.lastChild.previousSibling;
michael@0 69
michael@0 70 var actions = [
michael@0 71 {
michael@0 72 ID: muteBtn,
michael@0 73 actionName: "press",
michael@0 74 events: CLICK_EVENTS,
michael@0 75 eventSeq: [
michael@0 76 // new focusChecker(muteBtn),
michael@0 77 new nameChecker(muteBtn, "Unmute"),
michael@0 78 ]
michael@0 79 },
michael@0 80 // {
michael@0 81 // ID: scrubber,
michael@0 82 // actionName: "activate",
michael@0 83 // events: null,
michael@0 84 // eventSeq: [
michael@0 85 // new focusChecker(scrubber)
michael@0 86 // ]
michael@0 87 // },
michael@0 88 {
michael@0 89 ID: playBtn,
michael@0 90 actionName: "press",
michael@0 91 events: CLICK_EVENTS,
michael@0 92 eventSeq: [
michael@0 93 // new focusChecker(playBtn),
michael@0 94 new nameChecker(playBtn, "Pause"),
michael@0 95 ]
michael@0 96 }
michael@0 97 ];
michael@0 98
michael@0 99 testActions(actions); // Will call SimpleTest.finish();
michael@0 100 }
michael@0 101
michael@0 102 SimpleTest.waitForExplicitFinish();
michael@0 103 addA11yLoadEvent(doTest);
michael@0 104 </script>
michael@0 105 </head>
michael@0 106 <body>
michael@0 107
michael@0 108 <a target="_blank"
michael@0 109 title="Expose HTML5 video and audio elements' embedded controls through accessibility APIs"
michael@0 110 href="https://bugzilla.mozilla.org/show_bug.cgi?id=483573">Mozilla Bug 483573</a>
michael@0 111 <p id="display"></p>
michael@0 112 <div id="content" style="display: none"></div>
michael@0 113 <pre id="test">
michael@0 114 </pre>
michael@0 115
michael@0 116 <audio id="audio" src="../bug461281.ogg"
michael@0 117 controls="true"></audio>
michael@0 118
michael@0 119 <div id="eventDump"></div>
michael@0 120 </body>
michael@0 121 </html>

mercurial