Bug 1271120 - Port test_bug636465.xul from chrome to plain; r?masayuki
MozReview-Commit-ID: B0oaEGGEEvd
--- a/editor/libeditor/tests/chrome.ini
+++ b/editor/libeditor/tests/chrome.ini
@@ -10,17 +10,16 @@ support-files = spellcheck.js
[test_bug489202.xul]
[test_bug490879.xul]
subsuite = clipboard
[test_bug599983.xul]
skip-if = buildapp == 'mulet'
[test_bug607584.xul]
[test_bug616590.xul]
[test_bug635636.html]
-[test_bug636465.xul]
[test_bug646194.xul]
[test_bug780908.xul]
[test_bug830600.html]
subsuite = clipboard
[test_bug1053048.html]
[test_bug1100966.html]
[test_bug1102906.html]
[test_bug1101392.html]
--- a/editor/libeditor/tests/mochitest.ini
+++ b/editor/libeditor/tests/mochitest.ini
@@ -108,16 +108,17 @@ skip-if = toolkit == 'android'
[test_bug612128.html]
[test_bug612447.html]
[test_bug620906.html]
skip-if = toolkit == 'android' #TIMED_OUT
[test_bug622371.html]
skip-if = toolkit == 'android' #bug 957797
[test_bug625452.html]
[test_bug629845.html]
+[test_bug636465.html]
[test_bug638596.html]
[test_bug640321.html]
skip-if = android_version == '18' # bug 1147989
[test_bug641466.html]
[test_bug645914.html]
[test_bug668599.html]
[test_bug674770-1.html]
subsuite = clipboard
rename from editor/libeditor/tests/test_bug636465.xul
rename to editor/libeditor/tests/test_bug636465.html
--- a/editor/libeditor/tests/test_bug636465.xul
+++ b/editor/libeditor/tests/test_bug636465.html
@@ -1,61 +1,42 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin"
- type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=636465
--->
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- title="Mozilla Bug 636465" onload="runTest();">
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/WindowSnapshot.js"/>
+<!doctype html>
+<title>Mozilla bug 636465</title>
+<link rel=stylesheet href="/tests/SimpleTest/test.css">
+<script src="/tests/SimpleTest/EventUtils.js"></script>
+<script src="/tests/SimpleTest/SimpleTest.js"></script>
+<script src="/tests/SimpleTest/WindowSnapshot.js"></script>
+<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=636465"
+ target="_blank">Mozilla Bug 636465</a>
+<input id="x" value="foobarbaz" spellcheck="true">
+<script>
+SimpleTest.waitForExplicitFinish();
- <body xmlns="http://www.w3.org/1999/xhtml">
- <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=636465"
- target="_blank">Mozilla Bug 636465</a>
- <p/>
- <p/>
- <pre id="test">
- </pre>
- </body>
- <textbox id="x" value="foobarbaz" spellcheck="true"/>
- <script class="testbody" type="application/javascript">
- <![CDATA[
-
- SimpleTest.waitForExplicitFinish();
-
- function runTest() {
- Components.utils.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm");
- var x = document.getElementById("x");
+function runTest() {
+ SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm",
+ window);
+ var x = document.getElementById("x");
+ x.focus();
+ onSpellCheck(x, function () {
+ x.blur();
+ var spellCheckTrue = snapshotWindow(window);
+ x.setAttribute("spellcheck", "false");
+ var spellCheckFalse = snapshotWindow(window);
+ x.setAttribute("spellcheck", "true");
x.focus();
onSpellCheck(x, function () {
x.blur();
- var spellCheckTrue = snapshotWindow(window);
- x.setAttribute("spellcheck", "false");
- var spellCheckFalse = snapshotWindow(window);
- x.setAttribute("spellcheck", "true");
- x.focus();
- onSpellCheck(x, function () {
- x.blur();
- var spellCheckTrueAgain = snapshotWindow(window);
- x.removeAttribute("spellcheck");
- var spellCheckNone = snapshotWindow(window);
- var after = snapshotWindow(window);
- ok(compareSnapshots(spellCheckTrue, spellCheckFalse, false)[0],
- "Setting the spellcheck attribute to false should work");
- ok(compareSnapshots(spellCheckTrue, spellCheckTrueAgain, true)[0],
- "Setting the spellcheck attribute back to true should work");
- ok(compareSnapshots(spellCheckNone, spellCheckFalse, true)[0],
- "Unsetting the spellcheck attribute should work");
- SimpleTest.finish();
- });
+ var spellCheckTrueAgain = snapshotWindow(window);
+ x.removeAttribute("spellcheck");
+ var spellCheckNone = snapshotWindow(window);
+ var after = snapshotWindow(window);
+ ok(compareSnapshots(spellCheckTrue, spellCheckFalse, false)[0],
+ "Setting the spellcheck attribute to false should work");
+ ok(compareSnapshots(spellCheckTrue, spellCheckTrueAgain, true)[0],
+ "Setting the spellcheck attribute back to true should work");
+ ok(compareSnapshots(spellCheckNone, spellCheckFalse, true)[0],
+ "Unsetting the spellcheck attribute should work");
+ SimpleTest.finish();
});
- }
-]]>
+ });
+}
+addLoadEvent(runTest);
</script>
-</window>