Bug 1685962 - Fix test_bug549170.html to work on Linux with the native theme. r=spohl

Differential Revision: https://phabricator.services.mozilla.com/D101325
This commit is contained in:
Cameron McCormack 2021-01-21 00:22:53 +00:00
Родитель c67eaa1b46
Коммит d90d40b0c4
2 изменённых файлов: 13 добавлений и 11 удалений

Просмотреть файл

@ -26,7 +26,6 @@ skip-if = toolkit == 'android' # Bug 1658807
[test_bug534785.html]
[test_bug542914.html]
[test_bug549170.html]
fail-if = (os == 'linux' && os_version == '18.04' && !headless) # Bug 1599984
[test_bug562447.html]
[test_bug563642.html]
[test_bug564115.html]

Просмотреть файл

@ -32,30 +32,33 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549170
/** Test for Bug 549170 **/
var gNumberOfMouseEventsCatched = 0;
var gNumberOfMouseEventsCaught = 0;
SimpleTest.waitForExplicitFinish();
function mouseHandler(aEvent)
{
gNumberOfMouseEventsCatched++;
gNumberOfMouseEventsCaught++;
is(SpecialPowers.wrap(aEvent).originalTarget.nodeName, "DIV", "An inner div should be the target of the event");
ok(SpecialPowers.wrap(aEvent).originalTarget.implementedPseudoElement == "::-moz-text-control-editing-root", "the target div should be the editor div");
}
function checkMouseEvents(element)
{
gNumberOfMouseEventsCatched = 0;
gNumberOfMouseEventsCaught = 0;
synthesizeMouse(element, 7, 7, {type: "mousedown", button: 0});
synthesizeMouse(element, 7, 7, {type: "mouseup", button: 0});
synthesizeMouse(element, 7, 7, {type: "mousedown", button: 1});
let x = element.offsetWidth / 2;
let y = element.offsetHeight / 2;
synthesizeMouse(element, x, y, {type: "mousedown", button: 0});
synthesizeMouse(element, x, y, {type: "mouseup", button: 0});
synthesizeMouse(element, x, y, {type: "mousedown", button: 1});
// NOTE: this event is going to copy the buffer on linux, this should not be a problem
synthesizeMouse(element, 7, 7, {type: "mouseup", button: 1});
synthesizeMouse(element, 7, 7, {type: "mousedown", button: 2});
synthesizeMouse(element, 7, 7, {type: "mouseup", button: 2});
synthesizeMouse(element, x, y, {type: "mouseup", button: 1});
synthesizeMouse(element, x, y, {type: "mousedown", button: 2});
synthesizeMouse(element, x, y, {type: "mouseup", button: 2});
is(gNumberOfMouseEventsCatched, 6, "Some mouse events have not been catched");
is(gNumberOfMouseEventsCaught, 6, "Some mouse events have not been caught");
}
function runTests()