Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | <?xml version="1.0"?> |
michael@0 | 2 | <?xml-stylesheet href="chrome://global/skin" |
michael@0 | 3 | type="text/css"?> |
michael@0 | 4 | <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" |
michael@0 | 5 | type="text/css"?> |
michael@0 | 6 | <!-- |
michael@0 | 7 | https://bugzilla.mozilla.org/show_bug.cgi?id=636465 |
michael@0 | 8 | --> |
michael@0 | 9 | <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" |
michael@0 | 10 | title="Mozilla Bug 636465" onload="runTest();"> |
michael@0 | 11 | <script type="application/javascript" |
michael@0 | 12 | src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/> |
michael@0 | 13 | <script type="application/javascript" |
michael@0 | 14 | src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/> |
michael@0 | 15 | <script type="application/javascript" |
michael@0 | 16 | src="chrome://mochikit/content/tests/SimpleTest/WindowSnapshot.js"/> |
michael@0 | 17 | |
michael@0 | 18 | <body xmlns="http://www.w3.org/1999/xhtml"> |
michael@0 | 19 | <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=636465" |
michael@0 | 20 | target="_blank">Mozilla Bug 636465</a> |
michael@0 | 21 | <p/> |
michael@0 | 22 | <p/> |
michael@0 | 23 | <pre id="test"> |
michael@0 | 24 | </pre> |
michael@0 | 25 | </body> |
michael@0 | 26 | <textbox id="x" value="foobarbaz" spellcheck="true"/> |
michael@0 | 27 | <script class="testbody" type="application/javascript"> |
michael@0 | 28 | <![CDATA[ |
michael@0 | 29 | |
michael@0 | 30 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 31 | |
michael@0 | 32 | function runTest() { |
michael@0 | 33 | Components.utils.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm"); |
michael@0 | 34 | var x = document.getElementById("x"); |
michael@0 | 35 | x.focus(); |
michael@0 | 36 | onSpellCheck(x, function () { |
michael@0 | 37 | x.blur(); |
michael@0 | 38 | var spellCheckTrue = snapshotWindow(window); |
michael@0 | 39 | x.setAttribute("spellcheck", "false"); |
michael@0 | 40 | var spellCheckFalse = snapshotWindow(window); |
michael@0 | 41 | x.setAttribute("spellcheck", "true"); |
michael@0 | 42 | x.focus(); |
michael@0 | 43 | onSpellCheck(x, function () { |
michael@0 | 44 | x.blur(); |
michael@0 | 45 | var spellCheckTrueAgain = snapshotWindow(window); |
michael@0 | 46 | x.removeAttribute("spellcheck"); |
michael@0 | 47 | var spellCheckNone = snapshotWindow(window); |
michael@0 | 48 | var after = snapshotWindow(window); |
michael@0 | 49 | ok(compareSnapshots(spellCheckTrue, spellCheckFalse, false)[0], |
michael@0 | 50 | "Setting the spellcheck attribute to false should work"); |
michael@0 | 51 | ok(compareSnapshots(spellCheckTrue, spellCheckTrueAgain, true)[0], |
michael@0 | 52 | "Setting the spellcheck attribute back to true should work"); |
michael@0 | 53 | ok(compareSnapshots(spellCheckNone, spellCheckFalse, true)[0], |
michael@0 | 54 | "Unsetting the spellcheck attribute should work"); |
michael@0 | 55 | SimpleTest.finish(); |
michael@0 | 56 | }); |
michael@0 | 57 | }); |
michael@0 | 58 | } |
michael@0 | 59 | ]]> |
michael@0 | 60 | </script> |
michael@0 | 61 | </window> |