Bug 1662313: Add a wait on a selectionchange event to test_resizers_resizing_elements to prevent race condition in test; r=masayuki DONTBUILD

Wait for `selectionchange` to ensure that input events have been processed
before verifying a target's bounds.

Differential Revision: https://phabricator.services.mozilla.com/D88936
This commit is contained in:
Aaron Klotz 2020-09-01 04:46:04 +00:00
Родитель bce6a28762
Коммит 14408edb59
1 изменённых файлов: 4 добавлений и 0 удалений

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

@ -147,8 +147,12 @@ SimpleTest.waitForFocus(async () => {
// Move the mouse delta more pixels to the same direction to make sure that the
// resize operation has stopped.
synthesizeMouse(target, basePosX + deltaX * 2, basePosY + deltaY * 2, {type: "mousemove"});
// Click outside of the editor to hide the resizers
ok(true, "waiting selectionchange to select outside the target element");
let promiseSelectionExitEvent = waitForSelectionChange();
synthesizeMouseAtCenter(outOfEditor, {});
await promiseSelectionExitEvent;
// Get the new dimensions for the target
// XXX I don't know why we need 2px margin to check this on Android.