Bug 1526853 - Fix web replay test breakage from breakpoint actor removal.
authorBrian Hackett <bhackett1024@gmail.com>
Sun, 10 Feb 2019 21:18:56 -1000
changeset 458451 bcae5607db57bfb12d781289ed030970ceec72d3
parent 458450 136eb41d444fda4a5cdbf171c8b992975fc9ba0d
child 458452 491fc771924f074b997d18be782b70e22a07021b
child 458466 2bf86657a4482f75eef4469686d2eb246ee55dd2
push id111834
push userbhackett@mozilla.com
push dateMon, 11 Feb 2019 07:19:15 +0000
treeherdermozilla-inbound@bcae5607db57 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1526853
milestone67.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 1526853 - Fix web replay test breakage from breakpoint actor removal.
devtools/client/webreplay/mochitest/browser_dbg_rr_breakpoints-01.js
devtools/client/webreplay/mochitest/browser_dbg_rr_breakpoints-02.js
devtools/client/webreplay/mochitest/browser_dbg_rr_breakpoints-03.js
devtools/client/webreplay/mochitest/browser_dbg_rr_breakpoints-04.js
devtools/client/webreplay/mochitest/browser_dbg_rr_breakpoints-05.js
devtools/client/webreplay/mochitest/browser_dbg_rr_console_warp-01.js
devtools/client/webreplay/mochitest/browser_dbg_rr_replay-01.js
devtools/client/webreplay/mochitest/browser_dbg_rr_replay-02.js
devtools/client/webreplay/mochitest/browser_dbg_rr_stepping-01.js
devtools/client/webreplay/mochitest/browser_dbg_rr_stepping-02.js
devtools/client/webreplay/mochitest/browser_dbg_rr_stepping-03.js
devtools/client/webreplay/mochitest/browser_dbg_rr_stepping-04.js
devtools/client/webreplay/mochitest/head.js
--- a/devtools/client/webreplay/mochitest/browser_dbg_rr_breakpoints-01.js
+++ b/devtools/client/webreplay/mochitest/browser_dbg_rr_breakpoints-01.js
@@ -11,17 +11,17 @@
 // Test basic breakpoint functionality in web replay.
 add_task(async function() {
   const dbg = await attachRecordingDebugger(
     "doc_rr_basic.html",
     { waitForRecording: true }
   );
   const {threadClient, tab, toolbox} = dbg;
 
-  await setBreakpoint(threadClient, "doc_rr_basic.html", 21);
+  const bp = await setBreakpoint(threadClient, "doc_rr_basic.html", 21);
 
   // Visit a lot of breakpoints so that we are sure we have crossed major
   // checkpoint boundaries.
   await rewindToLine(threadClient, 21);
   await checkEvaluateInTopFrame(threadClient, "number", 10);
   await rewindToLine(threadClient, 21);
   await checkEvaluateInTopFrame(threadClient, "number", 9);
   await rewindToLine(threadClient, 21);
@@ -34,11 +34,12 @@ add_task(async function() {
   await checkEvaluateInTopFrame(threadClient, "number", 7);
   await resumeToLine(threadClient, 21);
   await checkEvaluateInTopFrame(threadClient, "number", 8);
   await resumeToLine(threadClient, 21);
   await checkEvaluateInTopFrame(threadClient, "number", 9);
   await resumeToLine(threadClient, 21);
   await checkEvaluateInTopFrame(threadClient, "number", 10);
 
+  await threadClient.removeBreakpoint(bp);
   await toolbox.closeToolbox();
   await gBrowser.removeTab(tab);
 });
--- a/devtools/client/webreplay/mochitest/browser_dbg_rr_breakpoints-02.js
+++ b/devtools/client/webreplay/mochitest/browser_dbg_rr_breakpoints-02.js
@@ -9,20 +9,21 @@
 // To disable all Web Replay tests, see browser.ini
 
 // Test unhandled divergence while evaluating at a breakpoint with Web Replay.
 add_task(async function() {
   const dbg = await attachRecordingDebugger("doc_rr_basic.html",
                                             { waitForRecording: true });
   const {threadClient, tab, toolbox} = dbg;
 
-  await setBreakpoint(threadClient, "doc_rr_basic.html", 21);
+  const bp = await setBreakpoint(threadClient, "doc_rr_basic.html", 21);
   await rewindToLine(threadClient, 21);
   await checkEvaluateInTopFrame(threadClient, "number", 10);
   await checkEvaluateInTopFrameThrows(threadClient, "window.alert(3)");
   await checkEvaluateInTopFrame(threadClient, "number", 10);
   await checkEvaluateInTopFrameThrows(threadClient, "window.alert(3)");
   await checkEvaluateInTopFrame(threadClient, "number", 10);
   await checkEvaluateInTopFrame(threadClient, "testStepping2()", undefined);
 
+  await threadClient.removeBreakpoint(bp);
   await toolbox.destroy();
   await gBrowser.removeTab(tab);
 });
--- a/devtools/client/webreplay/mochitest/browser_dbg_rr_breakpoints-03.js
+++ b/devtools/client/webreplay/mochitest/browser_dbg_rr_breakpoints-03.js
@@ -9,23 +9,26 @@
 // To disable all Web Replay tests, see browser.ini
 
 // Test some issues when stepping around after hitting a breakpoint while recording.
 add_task(async function() {
   const dbg = await attachRecordingDebugger("doc_rr_continuous.html");
   const {threadClient, tab, toolbox} = dbg;
 
   await threadClient.interrupt();
-  await setBreakpoint(threadClient, "doc_rr_continuous.html", 19);
+  const bp1 = await setBreakpoint(threadClient, "doc_rr_continuous.html", 19);
   await resumeToLine(threadClient, 19);
   await reverseStepOverToLine(threadClient, 18);
   await checkEvaluateInTopFrame(threadClient,
     "SpecialPowers.Cu.recordReplayDirective(/* AlwaysTakeTemporarySnapshots */ 3)",
     undefined);
   await stepInToLine(threadClient, 22);
-  await setBreakpoint(threadClient, "doc_rr_continuous.html", 24);
+  const bp2 = await setBreakpoint(threadClient, "doc_rr_continuous.html", 24);
   await resumeToLine(threadClient, 24);
-  await setBreakpoint(threadClient, "doc_rr_continuous.html", 22);
+  const bp3 = await setBreakpoint(threadClient, "doc_rr_continuous.html", 22);
   await rewindToLine(threadClient, 22);
 
+  await threadClient.removeBreakpoint(bp1);
+  await threadClient.removeBreakpoint(bp2);
+  await threadClient.removeBreakpoint(bp3);
   await toolbox.destroy();
   await gBrowser.removeTab(tab);
 });
--- a/devtools/client/webreplay/mochitest/browser_dbg_rr_breakpoints-04.js
+++ b/devtools/client/webreplay/mochitest/browser_dbg_rr_breakpoints-04.js
@@ -9,27 +9,28 @@
 // To disable all Web Replay tests, see browser.ini
 
 // Test navigating back to earlier breakpoints while recording, then resuming
 // recording.
 add_task(async function() {
   const dbg = await attachRecordingDebugger("doc_rr_continuous.html");
   const {threadClient, tab, toolbox} = dbg;
 
-  await setBreakpoint(threadClient, "doc_rr_continuous.html", 14);
+  const bp = await setBreakpoint(threadClient, "doc_rr_continuous.html", 14);
   await resumeToLine(threadClient, 14);
   const value = await evaluateInTopFrame(threadClient, "number");
   await resumeToLine(threadClient, 14);
   await checkEvaluateInTopFrame(threadClient, "number", value + 1);
   await rewindToLine(threadClient, 14);
   await checkEvaluateInTopFrame(threadClient, "number", value);
   await resumeToLine(threadClient, 14);
   await checkEvaluateInTopFrame(threadClient, "number", value + 1);
   await resumeToLine(threadClient, 14);
   await checkEvaluateInTopFrame(threadClient, "number", value + 2);
   await resumeToLine(threadClient, 14);
   await checkEvaluateInTopFrame(threadClient, "number", value + 3);
   await rewindToLine(threadClient, 14);
   await checkEvaluateInTopFrame(threadClient, "number", value + 2);
 
+  await threadClient.removeBreakpoint(bp);
   await toolbox.destroy();
   await gBrowser.removeTab(tab);
 });
--- a/devtools/client/webreplay/mochitest/browser_dbg_rr_breakpoints-05.js
+++ b/devtools/client/webreplay/mochitest/browser_dbg_rr_breakpoints-05.js
@@ -16,17 +16,18 @@ add_task(async function() {
     { waitForRecording: true }
   );
 
   const {threadClient, tab, toolbox} = dbg;
 
   // Rewind to the beginning of the recording.
   await rewindToLine(threadClient, undefined);
 
-  await setBreakpoint(threadClient, "doc_rr_basic.html", 21);
+  const bp = await setBreakpoint(threadClient, "doc_rr_basic.html", 21);
   await resumeToLine(threadClient, 21);
   await checkEvaluateInTopFrame(threadClient, "number", 1);
   await resumeToLine(threadClient, 21);
   await checkEvaluateInTopFrame(threadClient, "number", 2);
 
+  await threadClient.removeBreakpoint(bp);
   await toolbox.destroy();
   await gBrowser.removeTab(tab);
 });
--- a/devtools/client/webreplay/mochitest/browser_dbg_rr_console_warp-01.js
+++ b/devtools/client/webreplay/mochitest/browser_dbg_rr_console_warp-01.js
@@ -23,17 +23,18 @@ add_task(async function() {
   await threadClient.interrupt();
 
   await checkEvaluateInTopFrame(threadClient, "number", 5);
 
   // Initially we are paused inside the 'new Error()' call on line 19. The
   // first reverse step takes us to the start of that line.
   await reverseStepOverToLine(threadClient, 19);
   await reverseStepOverToLine(threadClient, 18);
-  await setBreakpoint(threadClient, "doc_rr_error.html", 12);
+  const bp = await setBreakpoint(threadClient, "doc_rr_error.html", 12);
   await rewindToLine(threadClient, 12);
   await checkEvaluateInTopFrame(threadClient, "number", 4);
   await resumeToLine(threadClient, 12);
   await checkEvaluateInTopFrame(threadClient, "number", 5);
 
+  await threadClient.removeBreakpoint(bp);
   await toolbox.destroy();
   await gBrowser.removeTab(tab);
 });
--- a/devtools/client/webreplay/mochitest/browser_dbg_rr_replay-01.js
+++ b/devtools/client/webreplay/mochitest/browser_dbg_rr_replay-01.js
@@ -24,20 +24,21 @@ add_task(async function() {
 
   const replayingTab = BrowserTestUtils.addTab(gBrowser, null,
                                                { replayExecution: recordingFile });
   gBrowser.selectedTab = replayingTab;
   await once(Services.ppmm, "HitRecordingEndpoint");
 
   const toolbox = await attachDebugger(replayingTab), client = toolbox.threadClient;
   await client.interrupt();
-  await setBreakpoint(client, "doc_rr_basic.html", 21);
+  const bp = await setBreakpoint(client, "doc_rr_basic.html", 21);
   await rewindToLine(client, 21);
   await checkEvaluateInTopFrame(client, "number", 10);
   await rewindToLine(client, 21);
   await checkEvaluateInTopFrame(client, "number", 9);
   await resumeToLine(client, 21);
   await checkEvaluateInTopFrame(client, "number", 10);
 
+  await client.removeBreakpoint(bp);
   await toolbox.destroy();
   await gBrowser.removeTab(recordingTab);
   await gBrowser.removeTab(replayingTab);
 });
--- a/devtools/client/webreplay/mochitest/browser_dbg_rr_replay-02.js
+++ b/devtools/client/webreplay/mochitest/browser_dbg_rr_replay-02.js
@@ -14,41 +14,43 @@ add_task(async function() {
 
   const recordingFile = newRecordingFile();
   const recordingTab = BrowserTestUtils.addTab(gBrowser, null, { recordExecution: "*" });
   gBrowser.selectedTab = recordingTab;
   openTrustedLinkIn(EXAMPLE_URL + "doc_rr_continuous.html", "current");
 
   let toolbox = await attachDebugger(recordingTab), client = toolbox.threadClient;
   await client.interrupt();
-  await setBreakpoint(client, "doc_rr_continuous.html", 14);
+  let bp = await setBreakpoint(client, "doc_rr_continuous.html", 14);
   await resumeToLine(client, 14);
   await resumeToLine(client, 14);
   await reverseStepOverToLine(client, 13);
   const lastNumberValue = await evaluateInTopFrame(client, "number");
 
   const tabParent = recordingTab.linkedBrowser.frameLoader.tabParent;
   ok(tabParent, "Found recording tab parent");
   ok(tabParent.saveRecording(recordingFile), "Saved recording");
   await once(Services.ppmm, "SaveRecordingFinished");
 
+  await client.removeBreakpoint(bp);
   await toolbox.destroy();
   await gBrowser.removeTab(recordingTab);
 
   const replayingTab = BrowserTestUtils.addTab(gBrowser, null,
                                                { replayExecution: recordingFile });
   gBrowser.selectedTab = replayingTab;
   await once(Services.ppmm, "HitRecordingEndpoint");
 
   toolbox = await attachDebugger(replayingTab);
   client = toolbox.threadClient;
   await client.interrupt();
   await checkEvaluateInTopFrame(client, "number", lastNumberValue);
   await reverseStepOverToLine(client, 13);
-  await setBreakpoint(client, "doc_rr_continuous.html", 14);
+  bp = await setBreakpoint(client, "doc_rr_continuous.html", 14);
   await rewindToLine(client, 14);
   await checkEvaluateInTopFrame(client, "number", lastNumberValue - 1);
   await resumeToLine(client, 14);
   await checkEvaluateInTopFrame(client, "number", lastNumberValue);
 
+  await client.removeBreakpoint(bp);
   await toolbox.destroy();
   await gBrowser.removeTab(replayingTab);
 });
--- a/devtools/client/webreplay/mochitest/browser_dbg_rr_stepping-01.js
+++ b/devtools/client/webreplay/mochitest/browser_dbg_rr_stepping-01.js
@@ -12,20 +12,21 @@
 add_task(async function() {
   const tab = BrowserTestUtils.addTab(gBrowser, null, { recordExecution: "*" });
   gBrowser.selectedTab = tab;
   openTrustedLinkIn(EXAMPLE_URL + "doc_rr_basic.html", "current");
   await once(Services.ppmm, "RecordingFinished");
 
   const toolbox = await attachDebugger(tab), client = toolbox.threadClient;
   await client.interrupt();
-  await setBreakpoint(client, "doc_rr_basic.html", 21);
+  const bp = await setBreakpoint(client, "doc_rr_basic.html", 21);
   await rewindToLine(client, 21);
   await checkEvaluateInTopFrame(client, "number", 10);
   await reverseStepOverToLine(client, 20);
   await checkEvaluateInTopFrame(client, "number", 9);
   await checkEvaluateInTopFrameThrows(client, "window.alert(3)");
   await stepOverToLine(client, 21);
   await checkEvaluateInTopFrame(client, "number", 10);
 
+  await client.removeBreakpoint(bp);
   await toolbox.destroy();
   await gBrowser.removeTab(tab);
 });
--- a/devtools/client/webreplay/mochitest/browser_dbg_rr_stepping-02.js
+++ b/devtools/client/webreplay/mochitest/browser_dbg_rr_stepping-02.js
@@ -12,21 +12,22 @@
 add_task(async function() {
   const tab = BrowserTestUtils.addTab(gBrowser, null, { recordExecution: "*" });
   gBrowser.selectedTab = tab;
   openTrustedLinkIn(EXAMPLE_URL + "doc_rr_basic.html", "current");
   await once(Services.ppmm, "RecordingFinished");
 
   const toolbox = await attachDebugger(tab), client = toolbox.threadClient;
   await client.interrupt();
-  await setBreakpoint(client, "doc_rr_basic.html", 22);
+  const bp = await setBreakpoint(client, "doc_rr_basic.html", 22);
   await rewindToLine(client, 22);
   await stepInToLine(client, 25);
   await stepOverToLine(client, 26);
   await stepOverToLine(client, 27);
   await reverseStepInToLine(client, 33);
   await reverseStepOverToLine(client, 32);
   await reverseStepOutToLine(client, 26);
   await reverseStepOverToLine(client, 25);
 
+  await client.removeBreakpoint(bp);
   await toolbox.destroy();
   await gBrowser.removeTab(tab);
 });
--- a/devtools/client/webreplay/mochitest/browser_dbg_rr_stepping-03.js
+++ b/devtools/client/webreplay/mochitest/browser_dbg_rr_stepping-03.js
@@ -11,20 +11,21 @@
 // Test stepping back while recording, then resuming recording.
 add_task(async function() {
   const tab = BrowserTestUtils.addTab(gBrowser, null, { recordExecution: "*" });
   gBrowser.selectedTab = tab;
   openTrustedLinkIn(EXAMPLE_URL + "doc_rr_continuous.html", "current");
 
   const toolbox = await attachDebugger(tab), client = toolbox.threadClient;
   await client.interrupt();
-  await setBreakpoint(client, "doc_rr_continuous.html", 13);
+  const bp = await setBreakpoint(client, "doc_rr_continuous.html", 13);
   await resumeToLine(client, 13);
   const value = await evaluateInTopFrame(client, "number");
   await reverseStepOverToLine(client, 12);
   await checkEvaluateInTopFrame(client, "number", value - 1);
   await resumeToLine(client, 13);
   await resumeToLine(client, 13);
   await checkEvaluateInTopFrame(client, "number", value + 1);
 
+  await client.removeBreakpoint(bp);
   await toolbox.destroy();
   await gBrowser.removeTab(tab);
 });
--- a/devtools/client/webreplay/mochitest/browser_dbg_rr_stepping-04.js
+++ b/devtools/client/webreplay/mochitest/browser_dbg_rr_stepping-04.js
@@ -12,17 +12,17 @@
 add_task(async function() {
   const tab = BrowserTestUtils.addTab(gBrowser, null, { recordExecution: "*" });
   gBrowser.selectedTab = tab;
   openTrustedLinkIn(EXAMPLE_URL + "doc_rr_basic.html", "current");
   await once(Services.ppmm, "RecordingFinished");
 
   const toolbox = await attachDebugger(tab), client = toolbox.threadClient;
   await client.interrupt();
-  await setBreakpoint(client, "doc_rr_basic.html", 21);
+  const bp = await setBreakpoint(client, "doc_rr_basic.html", 21);
   await rewindToLine(client, 21);
   await checkEvaluateInTopFrame(client, "number", 10);
   await reverseStepOverToLine(client, 20);
   await reverseStepOverToLine(client, 12);
 
   // After reverse-stepping out of the topmost frame we should rewind to the
   // last breakpoint hit.
   await reverseStepOverToLine(client, 21);
@@ -34,11 +34,12 @@ add_task(async function() {
   await stepOverToLine(client, 17);
   await stepOverToLine(client, 18);
 
   // After forward-stepping out of the topmost frame we should run forward to
   // the next breakpoint hit.
   await stepOverToLine(client, 21);
   await checkEvaluateInTopFrame(client, "number", 10);
 
+  await client.removeBreakpoint(bp);
   await toolbox.destroy();
   await gBrowser.removeTab(tab);
 });
--- a/devtools/client/webreplay/mochitest/head.js
+++ b/devtools/client/webreplay/mochitest/head.js
@@ -44,18 +44,19 @@ async function attachRecordingDebugger(u
   return {...dbg, tab, threadClient};
 }
 
 // Return a promise that resolves when a breakpoint has been set.
 async function setBreakpoint(threadClient, expectedFile, lineno) {
   const {sources} = await threadClient.getSources();
   ok(sources.length == 1, "Got one source");
   ok(RegExp(expectedFile).test(sources[0].url), "Source is " + expectedFile);
-  const sourceClient = threadClient.source(sources[0]);
-  await sourceClient.setBreakpoint({ line: lineno });
+  const location = { sourceUrl: sources[0].url, line: lineno };
+  await threadClient.setBreakpoint(location, {});
+  return location;
 }
 
 function resumeThenPauseAtLineFunctionFactory(method) {
   return async function(threadClient, lineno) {
     threadClient[method]();
     await threadClient.addOneTimeListener("paused", async function(event, packet) {
       const {frames} = await threadClient.getFrames(0, 1);
       const frameLine = frames[0] ? frames[0].where.line : undefined;
@@ -137,8 +138,13 @@ async function warpToMessage(hud, thread
     waitForThreadEvents(threadClient, "paused"),
   ]);
 
   messages = findMessages(hud, "", ".paused");
   ok(messages.length == 1, "Found one paused message");
 
   return message;
 }
+
+const { PromiseTestUtils } = scopedCuImport(
+  "resource://testing-common/PromiseTestUtils.jsm"
+);
+PromiseTestUtils.whitelistRejectionsGlobally(/NS_ERROR_NOT_INITIALIZED/);