browser_toolbox_ready.js 695 B

123456789101112131415161718192021
  1. /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
  2. /* Any copyright is dedicated to the Public Domain.
  3. * http://creativecommons.org/publicdomain/zero/1.0/ */
  4. const TEST_URL = "data:text/html,test for toolbox being ready";
  5. add_task(function* () {
  6. let tab = yield addTab(TEST_URL);
  7. let target = TargetFactory.forTab(tab);
  8. const toolbox = yield gDevTools.showToolbox(target, "webconsole");
  9. ok(toolbox.isReady, "toolbox isReady is set");
  10. ok(toolbox.threadClient, "toolbox has a thread client");
  11. const toolbox2 = yield gDevTools.showToolbox(toolbox.target, toolbox.toolId);
  12. is(toolbox2, toolbox, "same toolbox");
  13. yield toolbox.destroy();
  14. gBrowser.removeCurrentTab();
  15. });