Bug 1407945: Add a test for the tooltip in RDM. r=pbro

Differential Revision: https://phabricator.services.mozilla.com/D38827

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Daisuke Akatsuka 2019-07-29 08:32:46 +00:00
Родитель bbd3534237
Коммит d6be7f04ea
2 изменённых файлов: 37 добавлений и 0 удалений

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

@ -76,6 +76,8 @@ skip-if = fission
skip-if = os == "linux" || os == "mac" # Bug 1498336
[browser_toolbox_swap_browsers.js]
[browser_toolbox_swap_inspector.js]
[browser_tooltip.js]
skip-if = os == "mac" # Bug 1569508
[browser_touch_device.js]
[browser_touch_does_not_trigger_hover_states.js]
[browser_touch_simulation.js]

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

@ -0,0 +1,35 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const TEST_CONTENT = `<h1 title="test title">test h1</h1>`;
const TEST_URL = `data:text/html;charset=utf-8,${ TEST_CONTENT }`;
// Test for the tooltip coordinate on the browsing document in RDM.
addRDMTask(TEST_URL, async ({ ui }) => {
await injectEventUtilsInContentTask(ui.getViewportBrowser());
info("Show a tooltip");
await spawnViewportTask(ui, {}, async () => {
const target = content.document.querySelector("h1");
await EventUtils.synthesizeMouse(
target, 1, 1, { type: "mouseover", isSynthesized: false }, content
);
await EventUtils.synthesizeMouse(
target, 2, 1, { type: "mousemove", isSynthesized: false }, content
);
await EventUtils.synthesizeMouse(
target, 3, 1, { type: "mousemove", isSynthesized: false }, content
);
});
info("Wait for showing the tooltip");
const tooltip =
ui.browserWindow.gBrowser.ownerDocument.getElementById("remoteBrowserTooltip");
await waitUntil(() => tooltip.state === "open");
info("Test the X coordinate of the tooltip");
isnot(tooltip.screenX, 0, "The X coordinate of tooltip should not be 0");
});