summaryrefslogtreecommitdiffstats
path: root/browser/components/places/tests/browser/browser_library_tree_leak.js
blob: 9e552f5c317ac22f8f2b22ad3eba18cf93c9a6d5 (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
/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set sts=2 sw=2 et tw=80: */

"use strict";

add_task(async function bookmark_leak_window() {
  // A library window has two trees after selecting a bookmark item:
  // A left tree (#placesList) and a right tree (#placeContent).
  // Upon closing the window, both trees are destructed, in an unspecified
  // order. In bug 1520047, a memory leak was observed when the left tree
  // was destroyed last.

  let library = await promiseLibrary("BookmarksToolbar");
  let tree = library.document.getElementById("placesList");
  tree.selectItems(["toolbar_____"]);

  await synthesizeClickOnSelectedTreeCell(tree);
  await promiseLibraryClosed(library);

  Assert.ok(
    true,
    "Closing a window after selecting a node in the tree should not cause a leak"
  );
});