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