accessible/tests/mochitest/bounds/test_select.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/accessible/tests/mochitest/bounds/test_select.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,85 @@
     1.4 +<!DOCTYPE html>
     1.5 +<html>
     1.6 +<head>
     1.7 +  <title>Accessible boundaries when page is zoomed</title>
     1.8 +  <link rel="stylesheet" type="text/css"
     1.9 +        href="chrome://mochikit/content/tests/SimpleTest/test.css" />
    1.10 +
    1.11 +  <script type="application/javascript"
    1.12 +          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    1.13 +  <script type="application/javascript"
    1.14 +          src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
    1.15 +
    1.16 +  <script type="application/javascript"
    1.17 +          src="../common.js"></script>
    1.18 +  <script type="application/javascript"
    1.19 +          src="../role.js"></script>
    1.20 +  <script type="application/javascript"
    1.21 +          src="../layout.js"></script>
    1.22 +  <script type="application/javascript"
    1.23 +          src="../events.js"></script>
    1.24 +
    1.25 +  <script type="application/javascript">
    1.26 +    function openComboboxNCheckBounds(aID)
    1.27 +    {
    1.28 +      this.combobox = getAccessible(aID);
    1.29 +      this.comboboxList = this.combobox.firstChild;
    1.30 +      this.comboboxOption = this.comboboxList.firstChild;
    1.31 +
    1.32 +      this.eventSeq = [
    1.33 +        new invokerChecker(EVENT_FOCUS, this.comboboxOption)
    1.34 +      ];
    1.35 +
    1.36 +      this.invoke = function openComboboxNCheckBounds_invoke()
    1.37 +      {
    1.38 +        getNode(aID).focus();
    1.39 +        synthesizeKey("VK_DOWN", { altKey: true });
    1.40 +      }
    1.41 +
    1.42 +      this.finalCheck = function openComboboxNCheckBounds_invoke()
    1.43 +      {
    1.44 +        testBounds(this.comboboxOption);
    1.45 +      }
    1.46 +
    1.47 +      this.getID = function openComboboxNCheckBounds_getID()
    1.48 +      {
    1.49 +        return "open combobox and test boundaries";
    1.50 +      }
    1.51 +    }
    1.52 +
    1.53 +    //gA11yEventDumpToConsole = true;
    1.54 +
    1.55 +    var gQueue = null;
    1.56 +
    1.57 +    function doTest()
    1.58 +    {
    1.59 +      // Combobox
    1.60 +      testBounds("combobox");
    1.61 +
    1.62 +      // Option boundaries matches to combobox boundaries when collapsed.
    1.63 +      var selectBounds = getBoundsForDOMElm("combobox");
    1.64 +      testBounds("option1", selectBounds);
    1.65 +
    1.66 +      // Open combobox and test option boundaries.
    1.67 +      gQueue = new eventQueue();
    1.68 +      gQueue.push(new openComboboxNCheckBounds("combobox"));
    1.69 +      gQueue.invoke(); // Will call SimpleTest.finish();
    1.70 +    }
    1.71 +
    1.72 +    SimpleTest.waitForExplicitFinish();
    1.73 +    addA11yLoadEvent(doTest);
    1.74 +  </script>
    1.75 +</head>
    1.76 +<body>
    1.77 +
    1.78 +  <p id="display"></p>
    1.79 +  <div id="content" style="display: none"></div>
    1.80 +  <pre id="test">
    1.81 +  </pre>
    1.82 +
    1.83 +  <select id="combobox">
    1.84 +    <option id="option1">item1</option>
    1.85 +    <option>item2</option>
    1.86 +  </select>
    1.87 +</body>
    1.88 +</html>

mercurial