browser/base/content/test/general/browser_bug647886.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 function test() {
     5   waitForExplicitFinish();
     7   gBrowser.selectedTab = gBrowser.addTab();
     8   gBrowser.selectedBrowser.addEventListener("load", function () {
     9     gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
    11     content.history.pushState({}, "2", "2.html");
    13     testBackButton();
    14   }, true);
    16   loadURI("http://example.com");
    17 }
    19 function testBackButton() {
    20   var backButton = document.getElementById("back-button");
    21   var rect = backButton.getBoundingClientRect();
    23   info("waiting for the history menu to open");
    25   backButton.addEventListener("popupshown", function (event) {
    26     backButton.removeEventListener("popupshown", arguments.callee, false);
    28     ok(true, "history menu opened");
    29     event.target.hidePopup();
    30     gBrowser.removeTab(gBrowser.selectedTab);
    31     finish();
    32   }, false);
    34   EventUtils.synthesizeMouseAtCenter(backButton, {type: "mousedown"});
    35   EventUtils.synthesizeMouse(backButton, rect.width / 2, rect.height, {type: "mouseup"});
    36 }

mercurial