mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 685470 - Test. r=sicking
This commit is contained in:
parent
70677e268b
commit
24da502b72
@ -26,6 +26,7 @@ MOCHITEST_CHROME_FILES = \
|
||||
$(NULL)
|
||||
|
||||
MOCHITEST_BROWSER_FILES = \
|
||||
browser_bug685470.js \
|
||||
browser_bug703210.js \
|
||||
browser_bug706743.js \
|
||||
$(NULL)
|
||||
|
51
layout/xul/test/browser_bug685470.js
Normal file
51
layout/xul/test/browser_bug685470.js
Normal file
@ -0,0 +1,51 @@
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
|
||||
SpecialPowers.setIntPref("ui.tooltipDelay", 0);
|
||||
|
||||
var popup = false;
|
||||
var doc;
|
||||
var win;
|
||||
var p1;
|
||||
|
||||
let onPopupShown = function(aEvent) {
|
||||
popup = true;
|
||||
}
|
||||
|
||||
// test that a mouse click prior to the tooltip appearing blocks it
|
||||
let runTest = function() {
|
||||
EventUtils.synthesizeMouseAtCenter(p1, { type: "mousemove" }, win);
|
||||
EventUtils.sendMouseEvent({type:'mousedown'}, p1, win);
|
||||
EventUtils.sendMouseEvent({type:'mouseup'}, p1, win);
|
||||
|
||||
setTimeout(function() {
|
||||
is(popup, false, "shouldn't get tooltip after click");
|
||||
|
||||
document.removeEventListener("popupshown", onPopupShown, true);
|
||||
SpecialPowers.clearUserPref("ui.tooltipDelay");
|
||||
|
||||
gBrowser.removeCurrentTab();
|
||||
finish();
|
||||
}, 200);
|
||||
}
|
||||
|
||||
let onLoad = function (aEvent) {
|
||||
doc = gBrowser.contentDocument;
|
||||
win = gBrowser.contentWindow;
|
||||
p1 = doc.getElementById("p1");
|
||||
|
||||
document.addEventListener("popupshown", onPopupShown, true);
|
||||
|
||||
runTest();
|
||||
}
|
||||
|
||||
gBrowser.selectedBrowser.addEventListener("load", function loadListener() {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", loadListener, true);
|
||||
setTimeout(onLoad, 0);
|
||||
}, true);
|
||||
|
||||
content.location = "data:text/html," +
|
||||
"<p id=\"p1\" title=\"tooltip is here\">This paragraph has a tooltip.</p>";
|
||||
}
|
Loading…
Reference in New Issue
Block a user