tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

browser_bug749738.js (1047B)


      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 =
      8  // eslint-disable-next-line @microsoft/sdl/no-insecure-url
      9  "http://example.org/browser/browser/base/content/test/general/dummy_page.html";
     10 
     11 /**
     12 * This test checks that if you search for something on one tab, then close
     13 * that tab and have the find bar open on the next tab you get switched to,
     14 * closing the find bar in that tab works without exceptions.
     15 */
     16 add_task(async function test_bug749738() {
     17  // Open find bar on initial tab.
     18  await gFindBarPromise;
     19 
     20  await BrowserTestUtils.withNewTab(DUMMY_PAGE, async function () {
     21    await gFindBarPromise;
     22    gFindBar.onFindCommand();
     23    EventUtils.sendString("Dummy");
     24  });
     25 
     26  try {
     27    gFindBar.close();
     28    ok(true, "findbar.close should not throw an exception");
     29  } catch (e) {
     30    ok(false, "findbar.close threw exception: " + e);
     31  }
     32 });