accessible/tests/mochitest/test_OuterDocAccessible.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 <html>
     2 <!--
     3 https://bugzilla.mozilla.org/show_bug.cgi?id=441519
     4 -->
     5 <head>
     6   <title>nsOuterDocAccessible chrome tests</title>
     7   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
     9   <script type="application/javascript"
    10           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    12   <script type="application/javascript"
    13           src="common.js"></script>
    14   <script type="application/javascript"
    15           src="states.js"></script>
    16   <script type="application/javascript"
    17           src="role.js"></script>
    19   <script type="application/javascript">
    20     // needed error return value
    21     const ns_error_invalid_arg = Components.results.NS_ERROR_INVALID_ARG;
    23     function doTest()
    24     {
    25       // Get accessible for body tag.
    26       var docAcc = getAccessible(document);
    28       if (docAcc) {
    29         var outerDocAcc = getAccessible(docAcc.parent);
    31         if (outerDocAcc) {
    32           testRole(outerDocAcc, ROLE_INTERNAL_FRAME);
    34           // check if it is focusable.
    35           testStates(outerDocAcc, STATE_FOCUSABLE, 0);
    37           // see bug 428954: No name wanted for internal frame
    38           is(outerDocAcc.name, null, "Wrong name for internal frame!");
    40           // see bug 440770, no actions wanted on outer doc
    41           is(outerDocAcc.actionCount, 0,
    42              "Wrong number of actions for internal frame!");
    43           var actionTempStr; // not really used, just needs to receive a value
    44           try {
    45             actionTempStr = outerDocAcc.getActionName(0);
    46             do_throw("No exception thrown for actionName!");
    47           } catch(e) {
    48             ok(e.result, ns_error_invalid_arg,
    49                "Wrong return value for actionName call!");
    50           }
    52           try {
    53             actionTempStr = outerDocAcc.getActionDescription(0);
    54             do_throw("No exception thrown for actionDescription!");
    55           } catch(e) {
    56             ok(e.result, ns_error_invalid_arg,
    57                "Wrong return value for actionDescription call!");
    58           }
    60           try {
    61             outerDocAcc.doAction(0);
    62             do_throw("No exception thrown for doAction!");
    63           } catch(e) {
    64             ok(e.result, ns_error_invalid_arg,
    65                "Wrong return value for doAction call!");
    66           }
    67         }
    68       }
    70       SimpleTest.finish();
    71     }
    73     SimpleTest.waitForExplicitFinish();
    74     addA11yLoadEvent(doTest);
    75   </script>
    76 </head>
    77 <body>
    79   <a target="_blank"
    80      href="https://bugzilla.mozilla.org/show_bug.cgi?id=441519"
    81      title="nsOuterDocAccessible chrome tests">
    82     Mozilla Bug 441519
    83   </a>
    84   <p id="display"></p>
    85   <div id="content" style="display: none"></div>
    86   <pre id="test">
    87   </pre>
    88 </body>
    89 </html>

mercurial