browser_dbg_break-on-dom-01.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. thisTestLeaksUncaughtRejectionsAndShouldBeFixed(
  8. "TypeError: this.transport is null");
  9. /**
  10. * Tests that event listeners aren't fetched when the events tab isn't selected.
  11. */
  12. const TAB_URL = EXAMPLE_URL + "doc_event-listeners-02.html";
  13. function test() {
  14. let options = {
  15. source: TAB_URL,
  16. line: 1
  17. };
  18. initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
  19. let gPanel = aPanel;
  20. let gDebugger = aPanel.panelWin;
  21. let gView = gDebugger.DebuggerView;
  22. let gEvents = gView.EventListeners;
  23. let gController = gDebugger.DebuggerController;
  24. let constants = gDebugger.require("./content/constants");
  25. gDebugger.on(gDebugger.EVENTS.EVENT_LISTENERS_FETCHED, () => {
  26. ok(false, "Shouldn't have fetched any event listeners.");
  27. });
  28. gDebugger.on(gDebugger.EVENTS.EVENT_BREAKPOINTS_UPDATED, () => {
  29. ok(false, "Shouldn't have updated any event breakpoints.");
  30. });
  31. gView.toggleInstrumentsPane({ visible: true, animated: false });
  32. is(gView.instrumentsPaneHidden, false,
  33. "The instruments pane should be visible now.");
  34. is(gView.instrumentsPaneTab, "variables-tab",
  35. "The variables tab should be selected by default.");
  36. Task.spawn(function* () {
  37. is(gEvents.itemCount, 0, "There should be no events before reloading.");
  38. let reloaded = waitForNavigation(gPanel);
  39. gDebugger.DebuggerController._target.activeTab.reload();
  40. is(gEvents.itemCount, 0, "There should be no events while reloading.");
  41. yield reloaded;
  42. is(gEvents.itemCount, 0, "There should be no events after reloading.");
  43. yield closeDebuggerAndFinish(aPanel);
  44. });
  45. });
  46. }