Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
1 <!DOCTYPE html>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=452161
5 -->
6 <head>
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/tests/SimpleTest/SimpleTest.js"></script>
14 <script type="application/javascript"
15 src="../common.js"></script>
16 <script type="application/javascript"
17 src="../events.js"></script>
18 <script type="application/javascript"
19 src="editabletext.js"></script>
21 <script type="application/javascript">
23 function addTestEditable(aID, aTestRun)
24 {
25 var et = new editableTextTest(aID);
27 //////////////////////////////////////////////////////////////////////////
28 // setTextContents
29 et.scheduleTest(et.setTextContents, "hello");
30 et.scheduleTest(et.setTextContents, "olleh");
31 et.scheduleTest(et.setTextContents, "");
33 //////////////////////////////////////////////////////////////////////////
34 // insertText
35 et.scheduleTest(et.insertText, "hello", 0, "hello");
36 et.scheduleTest(et.insertText, "ma ", 0, "ma hello");
37 et.scheduleTest(et.insertText, "ma", 2, "mama hello");
38 et.scheduleTest(et.insertText, " hello", 10, "mama hello hello");
40 // XXX: bug 452584
42 //////////////////////////////////////////////////////////////////////////
43 // deleteText
44 // et.deleteText(0, 5, "hello hello");
45 // et.deleteText(5, 6, "hellohello");
46 // et.deleteText(5, 10, "hello");
47 // et.deleteText(0, 5, "");
49 //////////////////////////////////////////////////////////////////////////
50 // copyNPasteText
51 // et.copyNPasteText(0, 0, 0, "");
52 // et.insertText("hello", 0, "hello");
53 // et.copyNPasteText(0, 1, 0, "hhello");
54 // et.copyNPasteText(5, 6, 6, "hhelloo");
55 // et.copyNPasteText(3, 4, 1, "hehelloo");
57 //////////////////////////////////////////////////////////////////////////
58 // // cutNPasteText
59 // et.cutNPasteText(0, 1, 1, "ehhelloo");
60 // et.cutNPasteText(1, 2, 0, "hehelloo");
61 // et.cutNPasteText(7, 8, 8, "hehelloo");
63 aTestRun.add(et);
64 }
66 //gA11yEventDumpToConsole = true; // debug stuff
68 function runTest()
69 {
70 var testRun = new editableTextTestRun();
72 addTestEditable("input", testRun);
73 addTestEditable("div", testRun);
74 addTestEditable(getNode("frame").contentDocument, testRun, '\n');
76 testRun.run(); // Will call SimpleTest.finish();
77 }
79 function doTest()
80 {
81 // Prepare tested elements.
83 // Design mode on/off triggers an editable state change event on
84 // the document accessible.
85 var frame = getNode("frame");
86 waitForEvent(EVENT_STATE_CHANGE, frame.contentDocument, runTest);
87 frame.contentDocument.designMode = "on";
88 }
90 SimpleTest.waitForExplicitFinish();
91 addA11yLoadEvent(doTest);
92 </script>
93 </head>
94 <body>
96 <a target="_blank"
97 title="nsIAccessibleEditableText chrome tests"
98 href="https://bugzilla.mozilla.org/show_bug.cgi?id=452161">Mozilla Bug 452161</a>
99 <a target="_blank"
100 title="Cache rendered text on a11y side"
101 href="https://bugzilla.mozilla.org/show_bug.cgi?id=626660">
102 Mozilla Bug 626660
103 </a>
104 <p id="display"></p>
105 <div id="content" style="display: none"></div>
106 <pre id="test">
107 </pre>
109 <input id="input"/>
111 <div id="div" contentEditable="true"></div>
113 <iframe id="frame"/>
114 </body>
115 </html>