michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: "use strict"; michael@0: michael@0: const DUMMY_PAGE = "http://example.org/browser/browser/base/content/test/general/dummy_page.html"; michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: let tab = gBrowser.addTab(); michael@0: gBrowser.selectedTab = tab; michael@0: michael@0: load(tab, DUMMY_PAGE, function() { michael@0: gFindBar.onFindCommand(); michael@0: EventUtils.sendString("Dummy"); michael@0: gBrowser.removeTab(tab); michael@0: michael@0: try { michael@0: gFindBar.close(); michael@0: ok(true, "findbar.close should not throw an exception"); michael@0: } catch(e) { michael@0: ok(false, "findbar.close threw exception: " + e); michael@0: } michael@0: finish(); michael@0: }); michael@0: } michael@0: michael@0: function load(aTab, aUrl, aCallback) { michael@0: aTab.linkedBrowser.addEventListener("load", function onload(aEvent) { michael@0: aEvent.currentTarget.removeEventListener("load", onload, true); michael@0: waitForFocus(aCallback, content); michael@0: }, true); michael@0: aTab.linkedBrowser.loadURI(aUrl); michael@0: }