michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: // ---------- michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: let urlBase = "http://mochi.test:8888/browser/browser/components/tabview/test/"; michael@0: let newTab = gBrowser.addTab(urlBase + "search1.html"); michael@0: michael@0: registerCleanupFunction(function() { michael@0: if (gBrowser.tabs[1]) michael@0: gBrowser.removeTab(gBrowser.tabs[1]); michael@0: TabView.hide(); michael@0: }); michael@0: michael@0: afterAllTabsLoaded(function() { michael@0: showTabView(function() { michael@0: hideTabView(function() { michael@0: newTab.linkedBrowser.loadURI(urlBase + "dummy_page.html"); michael@0: michael@0: newWindowWithTabView(function(win) { michael@0: registerCleanupFunction(function() win.close()); michael@0: michael@0: let contentWindow = win.TabView.getContentWindow(); michael@0: michael@0: EventUtils.synthesizeKey("d", { }, contentWindow); michael@0: EventUtils.synthesizeKey("u", { }, contentWindow); michael@0: EventUtils.synthesizeKey("m", { }, contentWindow); michael@0: michael@0: let resultsElement = contentWindow.document.getElementById("results"); michael@0: let childElements = resultsElement.childNodes; michael@0: michael@0: is(childElements.length, 1, "There is one result element"); michael@0: is(childElements[0].childNodes[1].textContent, michael@0: "This is a dummy test page", michael@0: "The label matches the title of dummy page"); michael@0: michael@0: finish(); michael@0: }); michael@0: }); michael@0: }); michael@0: }); michael@0: } michael@0: