Bug 1739320 - Replace synthesizeMouseAtCenter() with click() in clickJsonNode(). r=Honza

This approach seemed to fix bug 1734940.

Differential Revision: https://phabricator.services.mozilla.com/D134660
This commit is contained in:
Oriol Brufau 2022-01-03 13:24:29 +00:00
parent e6f780ebd5
commit 80d8efe286
2 changed files with 7 additions and 2 deletions

View File

@ -93,6 +93,9 @@ add_task(async function() {
await assertRowSelected(1);
// Synthetize multiple down arrow keydowns to select following rows.
await SpecialPowers.spawn(tab.linkedBrowser, [], function() {
content.document.querySelector(".treeTable").focus();
});
for (let i = 2; i < numRows; ++i) {
await BrowserTestUtils.synthesizeKey(
"VK_DOWN",

View File

@ -136,8 +136,10 @@ async function addJsonViewTab(
function clickJsonNode(selector) {
info("Expanding node: '" + selector + "'");
const browser = gBrowser.selectedBrowser;
return BrowserTestUtils.synthesizeMouseAtCenter(selector, {}, browser);
// eslint-disable-next-line no-shadow
return ContentTask.spawn(gBrowser.selectedBrowser, selector, selector => {
content.document.querySelector(selector).click();
});
}
/**