4 https://bugzilla.mozilla.org/show_bug.cgi?id=452161
7 <title>nsIAccessibleEditableText chrome tests
</title>
8 <link rel=
"stylesheet" type=
"text/css"
9 href=
"chrome://mochikit/content/tests/SimpleTest/test.css" />
11 <script type=
"application/javascript"
12 src=
"chrome://mochikit/content/MochiKit/packed.js"></script>
13 <script type=
"application/javascript"
14 src=
"chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
16 <script type=
"application/javascript"
17 src=
"../common.js"></script>
18 <script type=
"application/javascript"
19 src=
"../events.js"></script>
20 <script type=
"application/javascript"
21 src=
"editabletext.js"></script>
23 <script type=
"application/javascript">
24 function addTestEditable(aID, aTestRun)
26 var et = new editableTextTest(aID);
28 //////////////////////////////////////////////////////////////////////////
30 et.insertText(
"hello",
0,
"hello");
31 et.insertText(
"ma ",
0,
"ma hello");
32 et.insertText(
"ma",
2,
"mama hello");
33 et.insertText(
" hello",
10,
"mama hello hello");
37 //////////////////////////////////////////////////////////////////////////
39 // et.setTextContents(
"hello",
"hello");
40 // et.setTextContents(
"olleh",
"olleh");
41 // et.setTextContents(
"",
"");
43 //////////////////////////////////////////////////////////////////////////
45 // et.deleteText(
0,
5,
"hello hello");
46 // et.deleteText(
5,
6,
"hellohello");
47 // et.deleteText(
5,
10,
"hello");
48 // et.deleteText(
0,
5,
"");
50 //////////////////////////////////////////////////////////////////////////
52 // et.copyNPasteText(
0,
0,
0,
"");
53 // et.insertText(
"hello",
0,
"hello");
54 // et.copyNPasteText(
0,
1,
0,
"hhello");
55 // et.copyNPasteText(
5,
6,
6,
"hhelloo");
56 // et.copyNPasteText(
3,
4,
1,
"hehelloo");
58 //////////////////////////////////////////////////////////////////////////
60 // et.cutNPasteText(
0,
1,
1,
"ehhelloo");
61 // et.cutNPasteText(
1,
2,
0,
"hehelloo");
62 // et.cutNPasteText(
7,
8,
8,
"hehelloo");
69 var testRun = new editableTextTestRun();
71 addTestEditable(
"input", testRun);
72 // addTestEditable(
"div"); XXX: bug
452599
73 addTestEditable(getNode(
"frame").contentDocument, testRun);
75 testRun.run(); // Will call SimpleTest.finish();
80 // Prepare tested elements.
82 // Design mode on/off trigger document accessible subtree recreation.
83 var frame = getNode(
"frame");
84 waitForEvent(EVENT_REORDER, frame.contentDocument, runTest);
85 frame.contentDocument.designMode =
"on";
88 SimpleTest.waitForExplicitFinish();
89 addA11yLoadEvent(doTest);
95 title=
"nsIAccessibleEditableText chrome tests"
96 href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=452161">Mozilla Bug
452161</a>
98 <div id=
"content" style=
"display: none"></div>
104 <div id=
"div" contentEditable=
"true"/>