Bug 1314852 Make background and border of the input element in test_bug636465.html since it's sometimes not painted correctly r?smaug
The test compaires 4 screenshots for checking spellchecker's behavior. However, the input element is sometimes not painted correctly on Linux.
Even if I make it wait more delay before taking screenshot, the random failure isn't fixed. So, I guess that it's a bug of gfx of Theme API of GTK.
On the other hand, the most important thing here is, compairing the foreground contents of the input element. Therefore, this patch makes the background and border of the input element transparent. That prevents to use Theme API. This must be enough for fixing the random orange.
MozReview-Commit-ID: L2uXcPLvbNg
--- a/editor/libeditor/tests/test_bug636465.html
+++ b/editor/libeditor/tests/test_bug636465.html
@@ -1,17 +1,17 @@
<!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">
+<input id="x" value="foobarbaz" spellcheck="true" style="background-color: transparent; border: transparent;">
<script>
SimpleTest.waitForExplicitFinish();
function runTest() {
SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm",
window);
var x = document.getElementById("x");
x.focus();
@@ -23,20 +23,32 @@ function runTest() {
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],
+ var ret = compareSnapshots(spellCheckTrue, spellCheckFalse, false)[0];
+ ok(ret,
"Setting the spellcheck attribute to false should work");
- ok(compareSnapshots(spellCheckTrue, spellCheckTrueAgain, true)[0],
+ if (!ret) {
+ ok(false, "\nspellCheckTrue: " + spellCheckTrue.toDataURL() + "\nspellCheckFalse: " + spellCheckFalse.toDataURL());
+ }
+ ret = compareSnapshots(spellCheckTrue, spellCheckTrueAgain, true)[0];
+ ok(ret,
"Setting the spellcheck attribute back to true should work");
- ok(compareSnapshots(spellCheckNone, spellCheckFalse, true)[0],
+ if (!ret) {
+ ok(false, "\nspellCheckTrue: " + spellCheckTrue.toDataURL() + "\nspellCheckTrueAgain: " + spellCheckTrueAgain.toDataURL());
+ }
+ ret = compareSnapshots(spellCheckNone, spellCheckFalse, true)[0];
+ ok(ret,
"Unsetting the spellcheck attribute should work");
+ if (!ret) {
+ ok(false, "\spellCheckNone: " + spellCheckNone.toDataURL() + "\nspellCheckFalse: " + spellCheckFalse.toDataURL());
+ }
SimpleTest.finish();
});
});
}
addLoadEvent(runTest);
</script>