summaryrefslogtreecommitdiffstats
path: root/accessible/tests/mochitest/editabletext/test_2.html
blob: 1d252d836fc4b44330b74031c5c3d9a21260ea58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<!DOCTYPE html>
<html>
<head>
  <title>nsIAccessibleEditableText chrome tests</title>
  <link rel="stylesheet" type="text/css"
        href="chrome://mochikit/content/tests/SimpleTest/test.css" />

  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>

  <script type="application/javascript"
          src="../common.js"></script>
  <script type="application/javascript"
          src="../events.js"></script>
  <script type="application/javascript"
          src="editabletext.js"></script>

  <script type="application/javascript">
    function doTest() {
      var et = new editableTextTest("input");

      // 'ee' insertion/removal at 1 or 2 offset of 'hello'/'heeello' string
      // reports 'ee' text was inserted/removed at 2 offset.
      et.scheduleTest(et.insertText, "ee", 1, "heeello", 2);
      et.scheduleTest(et.copyText, 1, 3, "ee");
      et.scheduleTest(et.cutText, 1, 3, "hello", 2, 4);
      et.scheduleTest(et.insertText, "ee", 2, "heeello", 2);
      et.scheduleTest(et.cutText, 2, 4, "hello", 2, 4);

      et.scheduleTest(et.deleteText, 1, 3, "hlo");
      et.scheduleTest(et.pasteText, 1, "heelo");

      var testRun = new editableTextTestRun();
      testRun.add(et);
      testRun.run(); // Will call SimpleTest.finish();
    }

    SimpleTest.waitForExplicitFinish();
    addA11yLoadEvent(doTest);
  </script>
</head>
<body>

  <a target="_blank"
     title="HyperText accessible should get focus when the caret is positioned inside of it, text is changed or copied into clipboard by ATs"
     href="https://bugzilla.mozilla.org/show_bug.cgi?id=524115">
    Mozilla Bug 524115
  </a>
  <a target="_blank"
     title="Cache rendered text on a11y side"
     href="https://bugzilla.mozilla.org/show_bug.cgi?id=626660">
    Mozilla Bug 626660
  </a>
  <p id="display"></p>
  <div id="content" style="display: none"></div>
  <pre id="test">
  </pre>

  <input id="input" value="hello"/>

</body>
</html>