Bug 647886 - Pulling down Back/Forward menu requires an unnecessary delay. r=sdwilsh
This commit is contained in:
@@ -170,6 +170,7 @@ _BROWSER_FILES = \
|
||||
browser_bug616836.js \
|
||||
browser_bug623893.js \
|
||||
browser_bug624734.js \
|
||||
browser_bug647886.js \
|
||||
browser_findbarClose.js \
|
||||
browser_contextSearchTabPosition.js \
|
||||
browser_ctrlTab.js \
|
||||
|
||||
34
browser/base/content/test/browser_bug647886.js
Normal file
34
browser/base/content/test/browser_bug647886.js
Normal file
@@ -0,0 +1,34 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
gBrowser.selectedBrowser.addEventListener("load", function () {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
content.history.pushState({}, "2", "2.html");
|
||||
|
||||
testBackButton();
|
||||
}, true);
|
||||
|
||||
loadURI("http://example.com");
|
||||
}
|
||||
|
||||
function testBackButton() {
|
||||
var backButton = document.getElementById("back-button");
|
||||
var rect = backButton.getBoundingClientRect();
|
||||
|
||||
info("waiting for the history menu to open");
|
||||
|
||||
backButton.addEventListener("popupshown", function (event) {
|
||||
backButton.removeEventListener("popupshown", arguments.callee, false);
|
||||
|
||||
ok(true, "history menu opened");
|
||||
event.target.hidePopup();
|
||||
finish();
|
||||
}, false);
|
||||
|
||||
EventUtils.synthesizeMouseAtCenter(backButton, {type: "mousedown"});
|
||||
EventUtils.synthesizeMouse(backButton, rect.width / 2, rect.height, {type: "mouseup"});
|
||||
}
|
||||
Reference in New Issue
Block a user