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.

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

mercurial