Bug 1314057 - Remove unnecessary puase tests for debugger removal. r=jlast
authorDavid Walsh <dwalsh@mozilla.com>
Fri, 28 Sep 2018 09:35:21 -0500
changeset 494736 4bff01e1bc91f47e09917d44040d2f3d961a0bbc
parent 494735 0e50b65dc5e631d3e18560b747ea2ed30db70e9d
child 494737 0ae9f4ff48d9915b5de8384297d8fdf0cc562438
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlast
bugs1314057
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1314057 - Remove unnecessary puase tests for debugger removal. r=jlast
devtools/client/debugger/test/mochitest/browser2.ini
devtools/client/debugger/test/mochitest/browser_dbg_pause-exceptions-01.js
devtools/client/debugger/test/mochitest/browser_dbg_pause-exceptions-02.js
devtools/client/debugger/test/mochitest/browser_dbg_pause-no-step.js
--- a/devtools/client/debugger/test/mochitest/browser2.ini
+++ b/devtools/client/debugger/test/mochitest/browser2.ini
@@ -122,25 +122,16 @@ support-files =
 uses-unsafe-cpows = true
 skip-if = e10s && debug
 [browser_dbg_on-pause-raise.js]
 uses-unsafe-cpows = true
 skip-if = e10s && debug || os == "linux" # Bug 888811 & bug 891176
 [browser_dbg_optimized-out-vars.js]
 uses-unsafe-cpows = true
 skip-if = e10s && debug
-[browser_dbg_pause-exceptions-01.js]
-uses-unsafe-cpows = true
-skip-if = e10s && debug
-[browser_dbg_pause-exceptions-02.js]
-uses-unsafe-cpows = true
-skip-if = e10s && debug
-[browser_dbg_pause-no-step.js]
-uses-unsafe-cpows = true
-skip-if = e10s && debug
 [browser_dbg_pause-resume.js]
 uses-unsafe-cpows = true
 skip-if = e10s && debug
 [browser_dbg_pause-warning.js]
 uses-unsafe-cpows = true
 skip-if = e10s && debug
 [browser_dbg_paused-keybindings.js]
 skip-if = e10s
deleted file mode 100644
--- a/devtools/client/debugger/test/mochitest/browser_dbg_pause-exceptions-01.js
+++ /dev/null
@@ -1,246 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Make sure that pausing on exceptions works.
- */
-
-const TAB_URL = EXAMPLE_URL + "doc_pause-exceptions.html";
-
-var gTab, gPanel, gDebugger;
-var gFrames, gVariables, gPrefs, gOptions;
-
-function test() {
-  requestLongerTimeout(2);
-  let options = {
-    source: TAB_URL,
-    line: 1
-  };
-  initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
-    gTab = aTab;
-    gPanel = aPanel;
-    gDebugger = gPanel.panelWin;
-    gFrames = gDebugger.DebuggerView.StackFrames;
-    gVariables = gDebugger.DebuggerView.Variables;
-    gPrefs = gDebugger.Prefs;
-    gOptions = gDebugger.DebuggerView.Options;
-
-    is(gPrefs.pauseOnExceptions, false,
-      "The pause-on-exceptions pref should be disabled by default.");
-    isnot(gOptions._pauseOnExceptionsItem.getAttribute("checked"), "true",
-      "The pause-on-exceptions menu item should not be checked.");
-
-    testPauseOnExceptionsDisabled()
-      .then(enablePauseOnExceptions)
-      .then(disableIgnoreCaughtExceptions)
-      .then(testPauseOnExceptionsEnabled)
-      .then(disablePauseOnExceptions)
-      .then(enableIgnoreCaughtExceptions)
-      .then(() => closeDebuggerAndFinish(gPanel))
-      .catch(aError => {
-        ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
-      });
-  });
-}
-
-function testPauseOnExceptionsDisabled() {
-  let finished = waitForCaretAndScopes(gPanel, 26).then(() => {
-    info("Testing disabled pause-on-exceptions.");
-
-    is(gDebugger.gThreadClient.state, "paused",
-      "Should only be getting stack frames while paused (1).");
-    ok(isCaretPos(gPanel, 26),
-      "Should be paused on the debugger statement (1).");
-
-    let innerScope = gVariables.getScopeAtIndex(0);
-    let innerNodes = innerScope.target.querySelector(".variables-view-element-details").childNodes;
-
-    is(gFrames.itemCount, 1,
-      "Should have one frame.");
-    is(gVariables._store.length, 4,
-      "Should have four scopes.");
-
-    is(innerNodes[0].querySelector(".name").getAttribute("value"), "this",
-      "Should have the right property name for 'this'.");
-    is(innerNodes[0].querySelector(".value").getAttribute("value"), "<button>",
-      "Should have the right property value for 'this'.");
-
-    let finished = waitForDebuggerEvents(gPanel, gDebugger.EVENTS.AFTER_FRAMES_CLEARED).then(() => {
-      isnot(gDebugger.gThreadClient.state, "paused",
-        "Should not be paused after resuming.");
-      ok(isCaretPos(gPanel, 26),
-        "Should be idle on the debugger statement.");
-
-      ok(true, "Frames were cleared, debugger didn't pause again.");
-    });
-
-    EventUtils.sendMouseEvent({ type: "mousedown" },
-      gDebugger.document.getElementById("resume"),
-      gDebugger);
-
-    return finished;
-  });
-
-  generateMouseClickInTab(gTab, "content.document.querySelector('button')");
-
-  return finished;
-}
-
-function testPauseOnExceptionsEnabled() {
-  let finished = waitForCaretAndScopes(gPanel, 19).then(() => {
-    info("Testing enabled pause-on-exceptions.");
-
-    is(gDebugger.gThreadClient.state, "paused",
-      "Should only be getting stack frames while paused.");
-    ok(isCaretPos(gPanel, 19),
-      "Should be paused on the debugger statement.");
-
-    let innerScope = gVariables.getScopeAtIndex(0);
-    let innerNodes = innerScope.target.querySelector(".variables-view-element-details").childNodes;
-
-    is(gFrames.itemCount, 1,
-      "Should have one frame.");
-    is(gVariables._store.length, 4,
-      "Should have four scopes.");
-
-    is(innerNodes[0].querySelector(".name").getAttribute("value"), "<exception>",
-      "Should have the right property name for <exception>.");
-    is(innerNodes[0].querySelector(".value").getAttribute("value"), "Error",
-      "Should have the right property value for <exception>.");
-
-    let finished = waitForCaretAndScopes(gPanel, 26).then(() => {
-      info("Testing enabled pause-on-exceptions and resumed after pause.");
-
-      is(gDebugger.gThreadClient.state, "paused",
-        "Should only be getting stack frames while paused.");
-      ok(isCaretPos(gPanel, 26),
-        "Should be paused on the debugger statement.");
-
-      let innerScope = gVariables.getScopeAtIndex(0);
-      let innerNodes = innerScope.target.querySelector(".variables-view-element-details").childNodes;
-
-      is(gFrames.itemCount, 1,
-        "Should have one frame.");
-      is(gVariables._store.length, 4,
-        "Should have four scopes.");
-
-      is(innerNodes[0].querySelector(".name").getAttribute("value"), "this",
-        "Should have the right property name for 'this'.");
-      is(innerNodes[0].querySelector(".value").getAttribute("value"), "<button>",
-        "Should have the right property value for 'this'.");
-
-      let finished = waitForDebuggerEvents(gPanel, gDebugger.EVENTS.AFTER_FRAMES_CLEARED).then(() => {
-        isnot(gDebugger.gThreadClient.state, "paused",
-          "Should not be paused after resuming.");
-        ok(isCaretPos(gPanel, 26),
-          "Should be idle on the debugger statement.");
-
-        ok(true, "Frames were cleared, debugger didn't pause again.");
-      });
-
-      EventUtils.sendMouseEvent({ type: "mousedown" },
-        gDebugger.document.getElementById("resume"),
-        gDebugger);
-
-      return finished;
-    });
-
-    EventUtils.sendMouseEvent({ type: "mousedown" },
-      gDebugger.document.getElementById("resume"),
-      gDebugger);
-
-    return finished;
-  });
-
-  generateMouseClickInTab(gTab, "content.document.querySelector('button')");
-
-  return finished;
-}
-
-function enablePauseOnExceptions() {
-  let deferred = promise.defer();
-
-  gDebugger.gThreadClient.addOneTimeListener("resumed", () => {
-    is(gPrefs.pauseOnExceptions, true,
-      "The pause-on-exceptions pref should now be enabled.");
-    is(gOptions._pauseOnExceptionsItem.getAttribute("checked"), "true",
-      "The pause-on-exceptions menu item should now be checked.");
-
-    ok(true, "Pausing on exceptions was enabled.");
-    deferred.resolve();
-  });
-
-  gOptions._pauseOnExceptionsItem.setAttribute("checked", "true");
-  gOptions._togglePauseOnExceptions();
-
-  return deferred.promise;
-}
-
-function disablePauseOnExceptions() {
-  let deferred = promise.defer();
-
-  gDebugger.gThreadClient.addOneTimeListener("resumed", () => {
-    is(gPrefs.pauseOnExceptions, false,
-      "The pause-on-exceptions pref should now be disabled.");
-    isnot(gOptions._pauseOnExceptionsItem.getAttribute("checked"), "true",
-      "The pause-on-exceptions menu item should now be unchecked.");
-
-    ok(true, "Pausing on exceptions was disabled.");
-    deferred.resolve();
-  });
-
-  gOptions._pauseOnExceptionsItem.setAttribute("checked", "false");
-  gOptions._togglePauseOnExceptions();
-
-  return deferred.promise;
-}
-
-function enableIgnoreCaughtExceptions() {
-  let deferred = promise.defer();
-
-  gDebugger.gThreadClient.addOneTimeListener("resumed", () => {
-    is(gPrefs.ignoreCaughtExceptions, true,
-      "The ignore-caught-exceptions pref should now be enabled.");
-    is(gOptions._ignoreCaughtExceptionsItem.getAttribute("checked"), "true",
-      "The ignore-caught-exceptions menu item should now be checked.");
-
-    ok(true, "Ignore caught exceptions was enabled.");
-    deferred.resolve();
-  });
-
-  gOptions._ignoreCaughtExceptionsItem.setAttribute("checked", "true");
-  gOptions._toggleIgnoreCaughtExceptions();
-
-  return deferred.promise;
-}
-
-function disableIgnoreCaughtExceptions() {
-  let deferred = promise.defer();
-
-  gDebugger.gThreadClient.addOneTimeListener("resumed", () => {
-    is(gPrefs.ignoreCaughtExceptions, false,
-      "The ignore-caught-exceptions pref should now be disabled.");
-    isnot(gOptions._ignoreCaughtExceptionsItem.getAttribute("checked"), "true",
-      "The ignore-caught-exceptions menu item should now be unchecked.");
-
-    ok(true, "Ignore caught exceptions was disabled.");
-    deferred.resolve();
-  });
-
-  gOptions._ignoreCaughtExceptionsItem.setAttribute("checked", "false");
-  gOptions._toggleIgnoreCaughtExceptions();
-
-  return deferred.promise;
-}
-
-registerCleanupFunction(function () {
-  gTab = null;
-  gPanel = null;
-  gDebugger = null;
-  gFrames = null;
-  gVariables = null;
-  gPrefs = null;
-  gOptions = null;
-});
deleted file mode 100644
--- a/devtools/client/debugger/test/mochitest/browser_dbg_pause-exceptions-02.js
+++ /dev/null
@@ -1,204 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Make sure that pausing on exceptions works after reload.
- */
-
-const TAB_URL = EXAMPLE_URL + "doc_pause-exceptions.html";
-
-var gTab, gPanel, gDebugger;
-var gFrames, gVariables, gPrefs, gOptions;
-
-function test() {
-  let options = {
-    source: TAB_URL,
-    line: 1
-  };
-  initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
-    gTab = aTab;
-    gPanel = aPanel;
-    gDebugger = gPanel.panelWin;
-    gFrames = gDebugger.DebuggerView.StackFrames;
-    gVariables = gDebugger.DebuggerView.Variables;
-    gPrefs = gDebugger.Prefs;
-    gOptions = gDebugger.DebuggerView.Options;
-
-    is(gPrefs.pauseOnExceptions, false,
-      "The pause-on-exceptions pref should be disabled by default.");
-    isnot(gOptions._pauseOnExceptionsItem.getAttribute("checked"), "true",
-      "The pause-on-exceptions menu item should not be checked.");
-
-    enablePauseOnExceptions()
-      .then(disableIgnoreCaughtExceptions)
-      .then(() => reloadActiveTab(gPanel, gDebugger.EVENTS.SOURCE_SHOWN))
-      .then(() => {
-        generateMouseClickInTab(gTab, "content.document.querySelector('button')");
-      })
-      .then(testPauseOnExceptionsAfterReload)
-      .then(disablePauseOnExceptions)
-      .then(enableIgnoreCaughtExceptions)
-      .then(() => closeDebuggerAndFinish(gPanel))
-      .catch(aError => {
-        ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
-      });
-  });
-}
-
-function testPauseOnExceptionsAfterReload() {
-  let finished = waitForCaretAndScopes(gPanel, 19).then(() => {
-    info("Testing enabled pause-on-exceptions.");
-
-    is(gDebugger.gThreadClient.state, "paused",
-      "Should only be getting stack frames while paused.");
-    ok(isCaretPos(gPanel, 19),
-      "Should be paused on the debugger statement.");
-
-    let innerScope = gVariables.getScopeAtIndex(0);
-    let innerNodes = innerScope.target.querySelector(".variables-view-element-details").childNodes;
-
-    is(gFrames.itemCount, 1,
-      "Should have one frame.");
-    is(gVariables._store.length, 4,
-      "Should have four scopes.");
-
-    is(innerNodes[0].querySelector(".name").getAttribute("value"), "<exception>",
-      "Should have the right property name for <exception>.");
-    is(innerNodes[0].querySelector(".value").getAttribute("value"), "Error",
-      "Should have the right property value for <exception>.");
-
-    let finished = waitForCaretAndScopes(gPanel, 26).then(() => {
-      info("Testing enabled pause-on-exceptions and resumed after pause.");
-
-      is(gDebugger.gThreadClient.state, "paused",
-        "Should only be getting stack frames while paused.");
-      ok(isCaretPos(gPanel, 26),
-        "Should be paused on the debugger statement.");
-
-      let innerScope = gVariables.getScopeAtIndex(0);
-      let innerNodes = innerScope.target.querySelector(".variables-view-element-details").childNodes;
-
-      is(gFrames.itemCount, 1,
-        "Should have one frame.");
-      is(gVariables._store.length, 4,
-        "Should have four scopes.");
-
-      is(innerNodes[0].querySelector(".name").getAttribute("value"), "this",
-        "Should have the right property name for 'this'.");
-      is(innerNodes[0].querySelector(".value").getAttribute("value"), "<button>",
-        "Should have the right property value for 'this'.");
-
-      let finished = waitForDebuggerEvents(gPanel, gDebugger.EVENTS.AFTER_FRAMES_CLEARED).then(() => {
-        isnot(gDebugger.gThreadClient.state, "paused",
-          "Should not be paused after resuming.");
-        ok(isCaretPos(gPanel, 26),
-          "Should be idle on the debugger statement.");
-
-        ok(true, "Frames were cleared, debugger didn't pause again.");
-      });
-
-      EventUtils.sendMouseEvent({ type: "mousedown" },
-        gDebugger.document.getElementById("resume"),
-        gDebugger);
-
-      return finished;
-    });
-
-    EventUtils.sendMouseEvent({ type: "mousedown" },
-      gDebugger.document.getElementById("resume"),
-      gDebugger);
-
-    return finished;
-  });
-
-  generateMouseClickInTab(gTab, "content.document.querySelector('button')");
-
-  return finished;
-}
-
-function enablePauseOnExceptions() {
-  let deferred = promise.defer();
-
-  gDebugger.gThreadClient.addOneTimeListener("resumed", () => {
-    is(gPrefs.pauseOnExceptions, true,
-      "The pause-on-exceptions pref should now be enabled.");
-    is(gOptions._pauseOnExceptionsItem.getAttribute("checked"), "true",
-      "The pause-on-exceptions menu item should now be checked.");
-
-    ok(true, "Pausing on exceptions was enabled.");
-    deferred.resolve();
-  });
-
-  gOptions._pauseOnExceptionsItem.setAttribute("checked", "true");
-  gOptions._togglePauseOnExceptions();
-  return deferred.promise;
-}
-
-function disablePauseOnExceptions() {
-  let deferred = promise.defer();
-
-  gDebugger.gThreadClient.addOneTimeListener("resumed", () => {
-    is(gPrefs.pauseOnExceptions, false,
-      "The pause-on-exceptions pref should now be disabled.");
-    isnot(gOptions._pauseOnExceptionsItem.getAttribute("checked"), "true",
-      "The pause-on-exceptions menu item should now be unchecked.");
-
-    ok(true, "Pausing on exceptions was disabled.");
-    deferred.resolve();
-  });
-
-  gOptions._pauseOnExceptionsItem.setAttribute("checked", "false");
-  gOptions._togglePauseOnExceptions();
-
-  return deferred.promise;
-}
-
-function enableIgnoreCaughtExceptions() {
-  let deferred = promise.defer();
-
-  gDebugger.gThreadClient.addOneTimeListener("resumed", () => {
-    is(gPrefs.ignoreCaughtExceptions, true,
-      "The ignore-caught-exceptions pref should now be enabled.");
-    is(gOptions._ignoreCaughtExceptionsItem.getAttribute("checked"), "true",
-      "The ignore-caught-exceptions menu item should now be checked.");
-
-    ok(true, "Ignore caught exceptions was enabled.");
-    deferred.resolve();
-  });
-
-  gOptions._ignoreCaughtExceptionsItem.setAttribute("checked", "true");
-  gOptions._toggleIgnoreCaughtExceptions();
-
-  return deferred.promise;
-}
-
-function disableIgnoreCaughtExceptions() {
-  let deferred = promise.defer();
-
-  gDebugger.gThreadClient.addOneTimeListener("resumed", () => {
-    is(gPrefs.ignoreCaughtExceptions, false,
-      "The ignore-caught-exceptions pref should now be disabled.");
-    isnot(gOptions._ignoreCaughtExceptionsItem.getAttribute("checked"), "true",
-      "The ignore-caught-exceptions menu item should now be unchecked.");
-
-    ok(true, "Ignore caught exceptions was disabled.");
-    deferred.resolve();
-  });
-
-  gOptions._ignoreCaughtExceptionsItem.setAttribute("checked", "false");
-  gOptions._toggleIgnoreCaughtExceptions();
-
-  return deferred.promise;
-}
-
-registerCleanupFunction(function () {
-  gTab = null;
-  gPanel = null;
-  gDebugger = null;
-  gFrames = null;
-  gVariables = null;
-  gPrefs = null;
-  gOptions = null;
-});
deleted file mode 100644
--- a/devtools/client/debugger/test/mochitest/browser_dbg_pause-no-step.js
+++ /dev/null
@@ -1,94 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Tests that pausing / stepping is only enabled when there is a
- * location.
- */
-
-const TAB_URL = EXAMPLE_URL + "doc_pause-exceptions.html";
-
-var gTab, gPanel, gDebugger;
-var gResumeButton, gStepOverButton, gStepOutButton, gStepInButton;
-var gResumeKey, gFrames;
-
-function test() {
-  let options = {
-    source: TAB_URL,
-    line: 1
-  };
-  initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
-    gTab = aTab;
-    gPanel = aPanel;
-    gDebugger = gPanel.panelWin;
-    gResumeButton = gDebugger.document.getElementById("resume");
-    gStepOverButton = gDebugger.document.getElementById("step-over");
-    gStepInButton = gDebugger.document.getElementById("step-in");
-    gStepOutButton = gDebugger.document.getElementById("step-out");
-    gResumeKey = gDebugger.document.getElementById("resumeKey");
-    gFrames = gDebugger.DebuggerView.StackFrames;
-
-    testPause();
-  });
-}
-
-function testPause() {
-  ok(!gDebugger.gThreadClient.paused, "Should be running after starting the test.");
-  ok(gStepOutButton.disabled, "Stepping out button should be disabled");
-  ok(gStepInButton.disabled, "Stepping in button should be disabled");
-  ok(gStepOverButton.disabled, "Stepping over button should be disabled");
-
-  gDebugger.gThreadClient.addOneTimeListener("paused", () => {
-    ok(gDebugger.gThreadClient.paused,
-       "Should be paused after an interrupt request.");
-
-    ok(!gStepOutButton.disabled, "Stepping out button should be enabled");
-    ok(!gStepInButton.disabled, "Stepping in button should be enabled");
-    ok(!gStepOverButton.disabled, "Stepping over button should be enabled");
-
-    waitForDebuggerEvents(gPanel, gDebugger.EVENTS.AFTER_FRAMES_REFILLED).then(() => {
-      is(gFrames.itemCount, 1,
-         "Should have 1 frame from the evalInTab call.");
-      gDebugger.gThreadClient.resume(testBreakAtLocation);
-    });
-
-  });
-
-  EventUtils.sendMouseEvent({ type: "mousedown" }, gResumeButton, gDebugger);
-
-  ok(!gDebugger.gThreadClient.paused,
-    "Shouldn't be paused until the next script is executed.");
-  ok(gStepOutButton.disabled, "Stepping out button should be disabled");
-  ok(gStepInButton.disabled, "Stepping in button should be disabled");
-  ok(gStepOverButton.disabled, "Stepping over button should be disabled");
-
-  // Evaluate a script to fully pause the debugger
-  once(gDebugger.gClient, "willInterrupt").then(() => {
-    evalInTab(gTab, "1+1;");
-  });
-}
-
-function testBreakAtLocation() {
-  gDebugger.gThreadClient.addOneTimeListener("paused", () => {
-    ok(!gStepOutButton.disabled, "Stepping out button should be enabled");
-    ok(!gStepInButton.disabled, "Stepping in button should be enabled");
-    ok(!gStepOverButton.disabled, "Stepping over button should be enabled");
-
-    resumeDebuggerThenCloseAndFinish(gPanel);
-  });
-
-  BrowserTestUtils.synthesizeMouseAtCenter("button", {}, gBrowser.selectedBrowser);
-}
-
-registerCleanupFunction(function () {
-  gPanel = null;
-  gDebugger = null;
-  gResumeButton = null;
-  gStepOverButton = null;
-  gStepInButton = null;
-  gStepOutButton = null;
-  gResumeKey = null;
-  gFrames = null;
-});