accessible/tests/mochitest/name/test_browserui.xul

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

     1 <?xml version="1.0"?>
     2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
     3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
     4                  type="text/css"?>
     6 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     7         title="Accessibility Name Calculating Test.">
     9   <script type="application/javascript"
    10           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
    11   <script type="application/javascript"
    12           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
    14   <script type="application/javascript"
    15           src="../common.js"></script>
    16   <script type="application/javascript"
    17           src="../role.js"></script>
    18   <script type="application/javascript"
    19           src="../states.js"></script>
    20   <script type="application/javascript"
    21           src="../events.js"></script>
    22   <script type="application/javascript"
    23           src="../browser.js"></script>
    25   <script type="application/javascript">
    26   <![CDATA[
    27     function addTab(aURL)
    28     {
    29       this.eventSeq = [
    30         new invokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, tabDocumentAt, 1)
    31       ];
    33       this.invoke = function addTab_invoke()
    34       {
    35         tabBrowser().addTab(aURL);
    36       }
    38       this.getID = function addTab_getID()
    39       {
    40         return "add tab: " + aURL;
    41       }
    42     }
    44     function switchTab(aTabBrowser, aWindow)
    45     {
    46       this.invoke = function switchTab_invoke()
    47       {
    48         synthesizeKey("VK_TAB", { ctrlKey: true }, browserWindow());
    49       }
    51       this.eventSeq = [
    52         new focusChecker(tabDocumentAt, 1)
    53       ];
    55       this.check = function switchTab_check(aEvent)
    56       {
    57         var title = getAccessible(browserDocument()).name;
    58         isnot(title.indexOf(aEvent.accessible.name), -1,
    59               "Window title contains the name of active tab document" +
    60               " (Is '" + aEvent.accessible.name + "' in '" + title + "'?)");
    61       }
    63       this.getID = function switchTab_getID() { return "switch tab"; }
    64     }
    66     ////////////////////////////////////////////////////////////////////////////
    67     // Tests
    69     //gA11yEventDumpID = "eventdump"; // debug stuff
    70     //gA11yEventDumpToConsole = true; // debug
    72     var gQueue = null;
    73     function doTests()
    74     {
    75       gQueue = new eventQueue();
    76       gQueue.push(new addTab("about:mozilla"));
    77       gQueue.push(new switchTab());
    78       gQueue.onFinish = function()
    79       {
    80         closeBrowserWindow();
    81       }
    83       gQueue.invoke();
    84     }
    86     SimpleTest.waitForExplicitFinish();
    87     openBrowserWindow(doTests, "about:");
    88   ]]>
    89   </script>
    91   <vbox flex="1" style="overflow: auto;">
    92   <body xmlns="http://www.w3.org/1999/xhtml">
    93     <a target="_blank"
    94        href="https://bugzilla.mozilla.org/show_bug.cgi?id=507382"
    95        title="focus is fired earlier than root accessible name is changed when switching between tabs">
    96       Mozilla Bug 
    97     </a>
    98     <p id="display"></p>
    99     <div id="content" style="display: none">
   100     </div>
   101     <pre id="test">
   102     </pre>
   103   </body>
   105   <vbox id="eventdump"></vbox>
   106   </vbox>
   107 </window>

mercurial