browser_dbg_terminate-on-tab-close.js 954 B

12345678910111213141516171819202122232425262728293031323334
  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. // Whitelisting this test.
  5. // As part of bug 1077403, the leaking uncaught rejections should be fixed.
  6. thisTestLeaksUncaughtRejectionsAndShouldBeFixed("[object Object]");
  7. /**
  8. * Tests that debuggee scripts are terminated on tab closure.
  9. */
  10. const TAB_URL = EXAMPLE_URL + "doc_terminate-on-tab-close.html";
  11. function test() {
  12. let options = {
  13. source: TAB_URL,
  14. line: 1
  15. };
  16. initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
  17. const gTab = aTab;
  18. const gPanel = aPanel;
  19. const gDebugger = gPanel.panelWin;
  20. gDebugger.gThreadClient.addOneTimeListener("paused", () => {
  21. resumeDebuggerThenCloseAndFinish(gPanel).then(function () {
  22. ok(true, "should not throw after this point");
  23. });
  24. });
  25. callInTab(gTab, "debuggerThenThrow");
  26. });
  27. }