author | Sebastian Hengst <archaeopteryx@coole-files.de> |
Mon, 14 Mar 2016 22:54:57 +0100 | |
changeset 288610 | 4dceeab3d7c52c946dfe5d06f443710b5ea718eb |
parent 288609 | e79cc51e486ceae0084e34ee3918e54e2942cf7e |
child 288611 | 9ccaec771922f823a5e006ccaff6fc177dd2ee4f |
push id | 73490 |
push user | archaeopteryx@coole-files.de |
push date | Mon, 14 Mar 2016 22:04:25 +0000 |
treeherder | mozilla-inbound@9ccaec771922 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | backout |
bugs | 1255919, 629172 |
milestone | 48.0a1 |
backs out | cc8b02b24319e086ddbf5ca4035818423ff0c8d5 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
editor/libeditor/moz.build | file | annotate | diff | comparison | revisions | |
editor/libeditor/tests/browser.ini | file | annotate | diff | comparison | revisions | |
editor/libeditor/tests/browser_bug629172.js | file | annotate | diff | comparison | revisions | |
editor/libeditor/tests/bug629172.html | file | annotate | diff | comparison | revisions | |
editor/libeditor/tests/mochitest.ini | file | annotate | diff | comparison | revisions | |
editor/libeditor/tests/test_bug629172.html | file | annotate | diff | comparison | revisions |
--- a/editor/libeditor/moz.build +++ b/editor/libeditor/moz.build @@ -6,18 +6,16 @@ MOCHITEST_MANIFESTS += [ 'tests/browserscope/mochitest.ini', 'tests/mochitest.ini', ] MOCHITEST_CHROME_MANIFESTS += ['tests/chrome.ini'] -BROWSER_CHROME_MANIFESTS += ['tests/browser.ini'] - UNIFIED_SOURCES += [ 'ChangeAttributeTxn.cpp', 'ChangeStyleTxn.cpp', 'CreateElementTxn.cpp', 'DeleteNodeTxn.cpp', 'DeleteRangeTxn.cpp', 'DeleteTextTxn.cpp', 'EditAggregateTxn.cpp',
deleted file mode 100644 --- a/editor/libeditor/tests/browser.ini +++ /dev/null @@ -1,3 +0,0 @@ -[browser_bug629172.js] -skip-if = toolkit == 'android' -support-files = bug629172.html
deleted file mode 100644 --- a/editor/libeditor/tests/browser_bug629172.js +++ /dev/null @@ -1,97 +0,0 @@ -add_task(function*() { - yield new Promise(resolve => waitForFocus(resolve, window)); - - const kPageURL = "http://example.org/browser/editor/libeditor/tests/bug629172.html"; - yield BrowserTestUtils.withNewTab({ - gBrowser, - url: kPageURL - }, function*(aBrowser) { - yield ContentTask.spawn(aBrowser, {}, function*() { - var window = content.window.wrappedJSObject; - var document = window.document; - - // Note: Using the with keyword, we would have been able to write this as: - // - // with (window) { - // Screenshots = {}; - // // so on - // } - // - // However, browser-chrome tests are somehow forced to run in strict mode, - // which doesn't permit the usage of the with keyword, turning the following - // into the ugliest test you've ever seen. :( - var LTRRef = document.getElementById("ltr-ref"); - var RTLRef = document.getElementById("rtl-ref"); - window.Screenshots = {}; - - // generate the reference screenshots - LTRRef.style.display = ""; - document.body.clientWidth; - window.Screenshots.ltr = window.snapshotWindow(window); - LTRRef.parentNode.removeChild(LTRRef); - RTLRef.style.display = ""; - document.body.clientWidth; - window.Screenshots.rtl = window.snapshotWindow(window); - RTLRef.parentNode.removeChild(RTLRef); - window.Screenshots.get = function(dir, flip) { - if (flip) { - return this[dir == "rtl" ? "ltr" : "rtl"]; - } else { - return this[dir]; - } - }; - }); - - function* testDirection(initialDir) { - yield ContentTask.spawn(aBrowser, {initialDir}, function({initialDir}) { - var window = content.window.wrappedJSObject; - var document = window.document; - - var t = window.t = document.createElement("textarea"); - t.setAttribute("dir", initialDir); - t.value = "test."; - window.inputEventCount = 0; - t.oninput = function() { window.inputEventCount++; }; - document.getElementById("content").appendChild(t); - document.body.clientWidth; - var s1 = window.snapshotWindow(window); - ok(window.compareSnapshots(s1, window.Screenshots.get(initialDir, false), true)[0], - "Textarea should appear correctly before switching the direction (" + initialDir + ")"); - t.focus(); - is(window.inputEventCount, 0, "input event count must be 0 before"); - }); - var waitForKeypress = BrowserTestUtils.waitForContentEvent(aBrowser, "keypress"); - EventUtils.synthesizeKey("x", {accelKey: true, shiftKey: true}); - yield waitForKeypress; - yield ContentTask.spawn(aBrowser, {initialDir}, function({initialDir}) { - var window = content.window.wrappedJSObject; - - is(window.t.getAttribute("dir"), initialDir == "ltr" ? "rtl" : "ltr", "The dir attribute must be correctly updated"); - is(window.inputEventCount, 1, "input event count must be 1 after"); - window.t.blur(); - var s2 = window.snapshotWindow(window); - ok(window.compareSnapshots(s2, window.Screenshots.get(initialDir, true), true)[0], - "Textarea should appear correctly after switching the direction (" + initialDir + ")"); - window.t.focus(); - is(window.inputEventCount, 1, "input event count must be 1 before"); - }); - waitForKeypress = BrowserTestUtils.waitForContentEvent(aBrowser, "keypress"); - EventUtils.synthesizeKey("x", {accelKey: true, shiftKey: true}); - yield waitForKeypress; - yield ContentTask.spawn(aBrowser, {initialDir}, function({initialDir}) { - var window = content.window.wrappedJSObject; - - is(window.inputEventCount, 2, "input event count must be 2 after"); - is(window.t.getAttribute("dir"), initialDir == "ltr" ? "ltr" : "rtl", "The dir attribute must be correctly updated"); - window.t.blur(); - var s3 = window.snapshotWindow(window); - ok(window.compareSnapshots(s3, window.Screenshots.get(initialDir, false), true)[0], - "Textarea should appear correctly after switching back the direction (" + initialDir + ")"); - window.t.parentNode.removeChild(window.t); - }); - } - - yield testDirection("ltr"); - yield testDirection("rtl"); - }); -});
deleted file mode 100644 --- a/editor/libeditor/tests/bug629172.html +++ /dev/null @@ -1,15 +0,0 @@ -<!DOCTYPE HTML> -<html> -<head> -<script type="text/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script> -<style> -textarea { resize: none } -</style> -</head> -<body> -<div id="content"> -<textarea id="ltr-ref" style="display: none">test.</textarea> -<textarea id="rtl-ref" style="display: none; direction: rtl">test.</textarea> -</div -</body> -</html>
--- a/editor/libeditor/tests/mochitest.ini +++ b/editor/libeditor/tests/mochitest.ini @@ -97,16 +97,18 @@ skip-if = toolkit == 'android' 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_bug629172.html] +skip-if = toolkit == 'android' || e10s [test_bug629845.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]
new file mode 100644 --- /dev/null +++ b/editor/libeditor/tests/test_bug629172.html @@ -0,0 +1,88 @@ +<!DOCTYPE HTML> +<html> +<!-- +https://bugzilla.mozilla.org/show_bug.cgi?id=629172 +--> +<head> + <title>Test for Bug 629172</title> + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> + <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script> + <script type="text/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> +</head> +<body> +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=629172">Mozilla Bug 629172</a> +<p id="display"></p> +<div id="content"> +<textarea id="ltr-ref" style="display: none">test.</textarea> +<textarea id="rtl-ref" style="display: none; direction: rtl">test.</textarea> +</div> +<pre id="test"> +<script type="application/javascript"> + +/** Test for Bug 629172 **/ +SimpleTest.waitForExplicitFinish(); +SimpleTest.waitForFocus(function() { + var LTRRef = document.getElementById("ltr-ref"); + var RTLRef = document.getElementById("rtl-ref"); + var Screenshots = {}; + + // generate the reference screenshots + LTRRef.style.display = ""; + document.body.clientWidth; + Screenshots.ltr = snapshotWindow(window); + LTRRef.parentNode.removeChild(LTRRef); + RTLRef.style.display = ""; + document.body.clientWidth; + Screenshots.rtl = snapshotWindow(window); + RTLRef.parentNode.removeChild(RTLRef); + Screenshots.get = function(dir, flip) { + if (flip) { + return this[dir == "rtl" ? "ltr" : "rtl"]; + } else { + return this[dir]; + } + }; + + function testDirection(initialDir) { + var t = document.createElement("textarea"); + t.setAttribute("dir", initialDir); + t.value = "test."; + var inputEventCount = 0; + t.oninput = function() { inputEventCount++; }; + document.getElementById("content").appendChild(t); + document.body.clientWidth; + var s1 = snapshotWindow(window); + ok(compareSnapshots(s1, Screenshots.get(initialDir, false), true)[0], + "Textarea should appear correctly before switching the direction (" + initialDir + ")"); + t.focus(); + is(inputEventCount, 0, "input event count must be 0 before"); + synthesizeKey("x", {accelKey: true, shiftKey: true}); + is(t.getAttribute("dir"), initialDir == "ltr" ? "rtl" : "ltr", "The dir attribute must be correctly updated"); + is(inputEventCount, 1, "input event count must be 1 after"); + t.blur(); + var s2 = snapshotWindow(window); + ok(compareSnapshots(s2, Screenshots.get(initialDir, true), true)[0], + "Textarea should appear correctly after switching the direction (" + initialDir + ")"); + t.focus(); + is(inputEventCount, 1, "input event count must be 1 before"); + synthesizeKey("x", {accelKey: true, shiftKey: true}); + is(inputEventCount, 2, "input event count must be 2 after"); + is(t.getAttribute("dir"), initialDir == "ltr" ? "ltr" : "rtl", "The dir attribute must be correctly updated"); + t.blur(); + var s3 = snapshotWindow(window); + ok(compareSnapshots(s3, Screenshots.get(initialDir, false), true)[0], + "Textarea should appear correctly after switching back the direction (" + initialDir + ")"); + t.parentNode.removeChild(t); + } + + testDirection("ltr"); + testDirection("rtl"); + + SimpleTest.finish(); +}); + +</script> +</pre> +</body> +</html>