browser/components/tabview/test/browser_tabview_bug623768.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   let newTab = gBrowser.loadOneTab("http://www.example.com/#1",
     8                                    { inBackground: false });
    10   // The executeSoon() call is really needed here because there's callback
    11   // waiting to be fired after gBrowser.loadOneTab(). After that the browser is
    12   // in a state where loadURI() will create a new entry in the session history
    13   // (that is vital for back/forward functionality).
    14   afterAllTabsLoaded(function() {
    15     executeSoon(function() {
    16       ok(!newTab.linkedBrowser.canGoBack, 
    17          "Browser should not be able to go back in history");
    19       newTab.linkedBrowser.loadURI("http://www.example.com/#2");
    21       afterAllTabsLoaded(function() {
    22         ok(newTab.linkedBrowser.canGoBack, 
    23            "Browser can go back in history after loading another URL");
    25         showTabView(function() {
    26           let contentWindow = document.getElementById("tab-view").contentWindow;
    28           EventUtils.synthesizeKey("VK_BACK_SPACE", { type: "keyup" }, contentWindow);
    30           // check after a delay
    31           executeSoon(function() {
    32             ok(newTab.linkedBrowser.canGoBack, 
    33                "Browser can still go back in history");
    35             hideTabView(function() {
    36               gBrowser.removeTab(newTab);
    37               finish();
    38             });
    39           });
    40         });
    41       });
    42     });
    43   });
    44 }

mercurial