browser/base/content/test/general/browser_bug749738.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:5d7e34de808e
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5 "use strict";
6
7 const DUMMY_PAGE = "http://example.org/browser/browser/base/content/test/general/dummy_page.html";
8
9 function test() {
10 waitForExplicitFinish();
11
12 let tab = gBrowser.addTab();
13 gBrowser.selectedTab = tab;
14
15 load(tab, DUMMY_PAGE, function() {
16 gFindBar.onFindCommand();
17 EventUtils.sendString("Dummy");
18 gBrowser.removeTab(tab);
19
20 try {
21 gFindBar.close();
22 ok(true, "findbar.close should not throw an exception");
23 } catch(e) {
24 ok(false, "findbar.close threw exception: " + e);
25 }
26 finish();
27 });
28 }
29
30 function load(aTab, aUrl, aCallback) {
31 aTab.linkedBrowser.addEventListener("load", function onload(aEvent) {
32 aEvent.currentTarget.removeEventListener("load", onload, true);
33 waitForFocus(aCallback, content);
34 }, true);
35 aTab.linkedBrowser.loadURI(aUrl);
36 }

mercurial