summaryrefslogtreecommitdiffstats
path: root/browser/base/content/test/general/browser_findbarClose.js
blob: 53503073c07a4d7d3a903598a1319b20698bf733 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */

// Tests find bar auto-close behavior

var newTab;

add_task(function* findbar_test() {
  waitForExplicitFinish();
  newTab = gBrowser.addTab("about:blank");

  let promise = ContentTask.spawn(newTab.linkedBrowser, null, function* () {
    yield ContentTaskUtils.waitForEvent(this, "DOMContentLoaded", false);
  });
  newTab.linkedBrowser.loadURI("http://example.com/browser/" +
    "browser/base/content/test/general/test_bug628179.html");
  yield promise;

  gFindBar.open();

  yield new ContentTask.spawn(newTab.linkedBrowser, null, function* () {
    let iframe = content.document.getElementById("iframe");
    let awaitLoad = ContentTaskUtils.waitForEvent(iframe, "load", false);
    iframe.src = "http://example.org/";
    yield awaitLoad;
  });

  ok(!gFindBar.hidden, "the Find bar isn't hidden after the location of a " +
     "subdocument changes");

  gFindBar.close();
  gBrowser.removeTab(newTab);
  finish();
});