browser/components/tabview/test/browser_tabview_bug656913.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 // ----------
     5 function test() {
     6   waitForExplicitFinish();
     8   let urlBase = "http://mochi.test:8888/browser/browser/components/tabview/test/";
     9   let newTab = gBrowser.addTab(urlBase + "search1.html");
    11   registerCleanupFunction(function() {
    12     if (gBrowser.tabs[1])
    13       gBrowser.removeTab(gBrowser.tabs[1]);
    14     TabView.hide();
    15   });
    17   afterAllTabsLoaded(function() {
    18     showTabView(function() {
    19       hideTabView(function() {
    20         newTab.linkedBrowser.loadURI(urlBase + "dummy_page.html");
    22         newWindowWithTabView(function(win) {
    23           registerCleanupFunction(function() win.close());
    25           let contentWindow = win.TabView.getContentWindow();
    27           EventUtils.synthesizeKey("d", { }, contentWindow);
    28           EventUtils.synthesizeKey("u", { }, contentWindow);
    29           EventUtils.synthesizeKey("m", { }, contentWindow);
    31           let resultsElement = contentWindow.document.getElementById("results");
    32           let childElements = resultsElement.childNodes;
    34           is(childElements.length, 1, "There is one result element");
    35           is(childElements[0].childNodes[1].textContent, 
    36              "This is a dummy test page", 
    37              "The label matches the title of dummy page");
    39           finish();
    40         });
    41       });
    42     });
    43   });
    44 }

mercurial