mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Backed out changeset 7410a15b0850 (bug 1251071) for permafailing browser_bookmark_popup.js on OS X. r=backout
This commit is contained in:
parent
6709abc048
commit
f10e7491d4
@ -25,7 +25,7 @@ var StarUI = {
|
||||
element.hidden = false;
|
||||
element.addEventListener("keypress", this, false);
|
||||
element.addEventListener("mouseout", this, false);
|
||||
element.addEventListener("mousemove", this, false);
|
||||
element.addEventListener("mouseover", this, false);
|
||||
element.addEventListener("popuphidden", this, false);
|
||||
element.addEventListener("popupshown", this, false);
|
||||
return this.panel = element;
|
||||
@ -63,7 +63,7 @@ var StarUI = {
|
||||
// nsIDOMEventListener
|
||||
handleEvent(aEvent) {
|
||||
switch (aEvent.type) {
|
||||
case "mousemove":
|
||||
case "mouseover":
|
||||
clearTimeout(this._autoCloseTimer);
|
||||
break;
|
||||
case "popuphidden":
|
||||
@ -138,9 +138,6 @@ var StarUI = {
|
||||
// Explicit fall-through
|
||||
}
|
||||
case "popupshown":
|
||||
if (aEvent.target != aEvent.currentTarget) {
|
||||
break;
|
||||
}
|
||||
// auto-close if new and not interacted with
|
||||
if (this._isNewBookmark) {
|
||||
// 3500ms matches the timeout that Pocket uses in
|
||||
@ -149,9 +146,7 @@ var StarUI = {
|
||||
if (this._closePanelQuickForTesting) {
|
||||
delay /= 10;
|
||||
}
|
||||
this._autoCloseTimer = setTimeout(() => {
|
||||
this.panel.hidePopup();
|
||||
}, delay);
|
||||
this._autoCloseTimer = setTimeout(() => this.panel.hidePopup(), delay, this);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -122,28 +122,28 @@ add_task(function* panel_shown_for_keyboardshortcut_on_new_bookmark_star_and_aut
|
||||
});
|
||||
});
|
||||
|
||||
add_task(function* panel_shown_for_new_bookmarks_mousemove_mouseout() {
|
||||
add_task(function* panel_shown_for_new_bookmarks_mouseover_mouseout() {
|
||||
yield test_bookmarks_popup({
|
||||
isNewBookmark: true,
|
||||
popupShowFn() {
|
||||
bookmarkStar.click();
|
||||
},
|
||||
*popupEditFn() {
|
||||
let mouseMovePromise = new Promise(resolve => {
|
||||
bookmarkPanel.addEventListener("mousemove", function onmousemove() {
|
||||
bookmarkPanel.removeEventListener("mousemove", onmousemove);
|
||||
let mouseOverPromise = new Promise(resolve => {
|
||||
bookmarkPanel.addEventListener("mouseover", function onmouseover() {
|
||||
bookmarkPanel.removeEventListener("mouseover", onmouseover);
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
yield new Promise(resolve => {
|
||||
EventUtils.synthesizeNativeMouseMove(bookmarkPanel, 0, 0, resolve, window);
|
||||
});
|
||||
info("Waiting for mousemove event");
|
||||
yield mouseMovePromise;
|
||||
info("Got mousemove event");
|
||||
info("Waiting for mouseover event");
|
||||
yield mouseOverPromise;
|
||||
info("Got mouseover event");
|
||||
|
||||
yield new Promise(resolve => setTimeout(resolve, 400));
|
||||
is(bookmarkPanel.state, "open", "Panel should still be open on mousemove");
|
||||
is(bookmarkPanel.state, "open", "Panel should still be open on mouseover");
|
||||
},
|
||||
*popupHideFn() {
|
||||
let mouseOutPromise = new Promise(resolve => {
|
||||
|
Loading…
Reference in New Issue
Block a user