Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* Any copyright is dedicated to the Public Domain. |
michael@0 | 2 | http://creativecommons.org/publicdomain/zero/1.0/ */ |
michael@0 | 3 | |
michael@0 | 4 | function test() { |
michael@0 | 5 | waitForExplicitFinish(); |
michael@0 | 6 | |
michael@0 | 7 | gBrowser.selectedTab = gBrowser.addTab(); |
michael@0 | 8 | gBrowser.selectedBrowser.addEventListener("load", function () { |
michael@0 | 9 | gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true); |
michael@0 | 10 | |
michael@0 | 11 | content.history.pushState({}, "2", "2.html"); |
michael@0 | 12 | |
michael@0 | 13 | testBackButton(); |
michael@0 | 14 | }, true); |
michael@0 | 15 | |
michael@0 | 16 | loadURI("http://example.com"); |
michael@0 | 17 | } |
michael@0 | 18 | |
michael@0 | 19 | function testBackButton() { |
michael@0 | 20 | var backButton = document.getElementById("back-button"); |
michael@0 | 21 | var rect = backButton.getBoundingClientRect(); |
michael@0 | 22 | |
michael@0 | 23 | info("waiting for the history menu to open"); |
michael@0 | 24 | |
michael@0 | 25 | backButton.addEventListener("popupshown", function (event) { |
michael@0 | 26 | backButton.removeEventListener("popupshown", arguments.callee, false); |
michael@0 | 27 | |
michael@0 | 28 | ok(true, "history menu opened"); |
michael@0 | 29 | event.target.hidePopup(); |
michael@0 | 30 | gBrowser.removeTab(gBrowser.selectedTab); |
michael@0 | 31 | finish(); |
michael@0 | 32 | }, false); |
michael@0 | 33 | |
michael@0 | 34 | EventUtils.synthesizeMouseAtCenter(backButton, {type: "mousedown"}); |
michael@0 | 35 | EventUtils.synthesizeMouse(backButton, rect.width / 2, rect.height, {type: "mouseup"}); |
michael@0 | 36 | } |