Merge inbound to mozilla-central. a=merge
authorCosmin Sabou <csabou@mozilla.com>
Mon, 26 Feb 2018 11:47:29 +0200
changeset 759663 02aa9c921aedfd0e768a92a6a8c5cba1b14191c1
parent 759662 b3c5a9368be8582eb288780ced71daed78c98a41 (current diff)
parent 759638 28d25664945a0626e1ef0062d7815ba8a63a909e (diff)
child 759664 4eac4e7870dab87df86ecf89825ab362f7129526
child 759667 24a09bb2a66564d522c796ef2a901762bdd0d6c4
child 759679 e74a3120c47f890790a8427cb39894bbffa9a98b
child 759684 a249c1d3216955b43cb106b3ed323d3a3232b3b5
child 759688 678f52801d100a980f529fc565d1009c38320ae4
child 759689 c601e742bcc4b5c84aeeaa8200f95d63a7c2b2bc
child 759699 1e070f3c236ed376fd08b046b3bb0e8e40dfe01e
child 759721 194ce199dfee7ee2300adb4e995a4cdd6ac8edcd
child 759722 052baac75886312436d10e636463f065cdc3d19a
child 759727 d3e316101e478a4e259411a4aae03e8c7fbc2fe4
child 759728 86feb44ae8cf9852eae260c4c41cba10fe07fbfa
child 759729 3d078e5c34ad1ebd8daf27e284c0546e1d00b748
child 759737 e310e7e236db5b6b1dd3dd98b2f4cb2703701a62
child 759748 deb094be28765710cd5ff9bbfb641f8acfb82843
child 759752 e2463048aa8d56ff47dc1285448919fefcac797d
child 759770 bd10385f380cb535dc09f503e7c60c2976f73c63
child 759815 3cf8a4c9805ec8b967d2832f2c43eb65059ca12e
child 759816 51fd5b69c8299ec09f775e98d0c668e8154084a5
child 759817 8f1597ad1fa9102c4214ae7d517aa664b270aaea
child 759818 e4b03f75c87e45c6b54d7db7c30f8ed3be12066e
child 759820 619c4ff7bf20c57d4eb1fecee22dd71d2f4ce9f9
child 759830 6d72eade26af359ffc3cd3e381fd79c88922b9b8
child 759841 e8b55251c1b6a6ac6175a290316adf6f75408077
child 759852 af3831e08743774c51488f2bdde7f8e62d3275e5
child 759853 953a6a4abaaaabfacacdc898b73429d3883b3d88
child 759856 ba69a74f22a2f529f805d511d453790e5ed6463a
child 759859 2a50c2db445a42a558f8e396d32b9ecf6cf5d3f9
child 759860 aac3059bd459c4c6570248c8a1724a0a43cb27d4
child 759912 acd167e70154f1f486788850cf987731cb5ae92c
child 759943 85d0b2c302339af54fdc89c12a1314106d65b8a2
child 759950 6a87620a5690ecea52e15010fdcfbf2302fb17fe
child 759973 f0526287f8c3331f250376ae26fd8c95304a6723
child 760065 c16fc7b02287b53f2270bcf847cdb32597288a1d
child 760067 cecbb69288d0f381da9195965da3f939c889ee09
child 760072 c38ff028d4e39629a9fb2a24d64a1295667010ca
child 760149 40b67722b7922d2eb06c9c4224fd7a9ded92575d
child 760161 6d758b34ad0fab939147952501b3936a426e38b8
child 760165 c6951ac3b6b7a6bfb52054a0e9b53465255370e2
child 760243 1c35bb435ff2e633121f223059e4db3aaf69d237
child 760252 edfa9cb3804daf4422c7dbaccde4f2d8524c44ee
child 760256 5aa7fb17985fcb71e30636e76cb674863a0aef63
child 760378 4bacfb7d9998f5581c43f1449563725d6f412e5a
child 760379 91f5acf88ea8599e499a4b09374f69ef1ca878cb
child 760423 05ffa73503a733c55aed7184f25222d8491f41f1
child 760424 38afe4398b60351813a7723a667c4f73fd87c3d8
child 760463 0238f162dbcb53ae41b4998d50277d7d51a3a44a
child 760513 f7cad0850fb8047bb36022963ba615b642f9179f
child 760522 5b6f1632459b7e86d56c9b71466e8d2cf4963d20
child 760534 e005b230f6258bc496f64bba91d61f21b9e9b701
child 760535 dd2cb444c8af6fae8eb8636d418c99d9b012f9fa
child 760774 553d7645f8c32273d27516a3a48cb780734c547b
child 760840 378a5ee30618017d6fec589a0bb20765cedfc34e
child 760841 f90625e03a7b9ff09bcee5bf59f06bd0f8278419
child 761154 7c68f4ef160b20b0fa587d211a00897fce799110
child 761156 e5781515982d53e5f1dd641a8a71454a74cb1087
child 761157 7513cd835ebf51edbcbf186b9f88ea5ed09a26a9
child 762219 95c0d6e65f2f517c894ac98a565c2481bc7a3cde
push id100424
push userbmo:ystartsev@mozilla.com
push dateMon, 26 Feb 2018 10:57:42 +0000
reviewersmerge
milestone60.0a1
Merge inbound to mozilla-central. a=merge
devtools/server/tests/unit/setBreakpoint-on-column-with-no-offsets-at-end-of-line.js
devtools/server/tests/unit/test_setBreakpoint-on-column-with-no-offsets-at-end-of-line.js
--- a/devtools/server/actors/source.js
+++ b/devtools/server/actors/source.js
@@ -923,24 +923,30 @@ let SourceActor = ActorClassWithSpec(sou
       for (let [script, columnToOffsetMap] of columnToOffsetMaps) {
         for (let { columnNumber: column, offset } of columnToOffsetMap) {
           if (column >= generatedColumn && column <= generatedLastColumn) {
             entryPoints.push({ script, offsets: [offset] });
           }
         }
       }
 
-      // If we don't find any matching entrypoints, then
-      // we should check to see if the breakpoint is to the left of the first offset.
+      // If we don't find any matching entrypoints,
+      // then we should see if the breakpoint comes before or after the column offsets.
       if (entryPoints.length === 0) {
         for (let [script, columnToOffsetMap] of columnToOffsetMaps) {
           if (columnToOffsetMap.length > 0) {
-            let { columnNumber: column, offset } = columnToOffsetMap[0];
-            if (generatedColumn < column) {
-              entryPoints.push({ script, offsets: [offset] });
+            const firstColumnOffset = columnToOffsetMap[0];
+            const lastColumnOffset = columnToOffsetMap[columnToOffsetMap.length - 1];
+
+            if (generatedColumn < firstColumnOffset.columnNumber) {
+              entryPoints.push({ script, offsets: [firstColumnOffset.offset] });
+            }
+
+            if (generatedColumn > lastColumnOffset.columnNumber) {
+              entryPoints.push({ script, offsets: [lastColumnOffset.offset] });
             }
           }
         }
       }
     }
 
     if (entryPoints.length === 0) {
       return false;
deleted file mode 100644
--- a/devtools/server/tests/unit/setBreakpoint-on-column-with-no-offsets-at-end-of-line.js
+++ /dev/null
@@ -1,6 +0,0 @@
-"use strict";
-
-function f() {
-  var a = 1; var b = 2;
-  var c = 3;
-}
--- a/devtools/server/tests/unit/test_setBreakpoint-at-the-beginning-of-a-line.js
+++ b/devtools/server/tests/unit/test_setBreakpoint-at-the-beginning-of-a-line.js
@@ -1,64 +1,59 @@
 "use strict";
 
 var SOURCE_URL = getFileUrl("setBreakpoint-on-column.js");
 
-function run_test() {
-  return async function () {
-    do_test_pending();
+async function run_test() {
+  do_test_pending();
+  DebuggerServer.registerModule("xpcshell-test/testactors");
+  DebuggerServer.init(() => true);
+  let global = createTestGlobal("test");
+  DebuggerServer.addTestGlobal(global);
 
-    DebuggerServer.registerModule("xpcshell-test/testactors");
-    DebuggerServer.init(() => true);
-
-    let global = createTestGlobal("test");
-    DebuggerServer.addTestGlobal(global);
-
-    let client = new DebuggerClient(DebuggerServer.connectPipe());
-    await connect(client);
+  let client = new DebuggerClient(DebuggerServer.connectPipe());
+  await connect(client);
 
-    let { tabs } = await listTabs(client);
-    let tab = findTab(tabs, "test");
-    let [, tabClient] = await attachTab(client, tab);
-    let [, threadClient] = await attachThread(tabClient);
-    await resume(threadClient);
+  let { tabs } = await listTabs(client);
+  let tab = findTab(tabs, "test");
+  let [, tabClient] = await attachTab(client, tab);
+  let [, threadClient] = await attachThread(tabClient);
+  await resume(threadClient);
 
-    let promise = waitForNewSource(threadClient, SOURCE_URL);
-    loadSubScript(SOURCE_URL, global);
-    let { source } = await promise;
-    let sourceClient = threadClient.source(source);
+  let promise = waitForNewSource(threadClient, SOURCE_URL);
+  loadSubScript(SOURCE_URL, global);
+  let { source } = await promise;
+  let sourceClient = threadClient.source(source);
 
-    let location = { line: 4, column: 2 };
-    let [packet, breakpointClient] = await setBreakpoint(
-      sourceClient,
-      location
-    );
+  let location = { line: 4, column: 2 };
+  let [packet, breakpointClient] = await setBreakpoint(
+    sourceClient,
+    location
+  );
 
-    Assert.ok(!packet.isPending);
-    Assert.equal(false, "actualLocation" in packet);
+  Assert.ok(!packet.isPending);
+  Assert.equal(false, "actualLocation" in packet);
 
-    packet = await executeOnNextTickAndWaitForPause(function () {
-      Cu.evalInSandbox("f()", global);
-    }, client);
+  packet = await executeOnNextTickAndWaitForPause(function () {
+    Cu.evalInSandbox("f()", global);
+  }, client);
 
-    Assert.equal(packet.type, "paused");
-    let why = packet.why;
-    Assert.equal(why.type, "breakpoint");
-    Assert.equal(why.actors.length, 1);
-    Assert.equal(why.actors[0], breakpointClient.actor);
+  Assert.equal(packet.type, "paused");
+  let why = packet.why;
+  Assert.equal(why.type, "breakpoint");
+  Assert.equal(why.actors.length, 1);
+  Assert.equal(why.actors[0], breakpointClient.actor);
 
-    let frame = packet.frame;
-    let where = frame.where;
-    Assert.equal(where.source.actor, source.actor);
-    Assert.equal(where.line, location.line);
-    Assert.equal(where.column, 6);
+  let frame = packet.frame;
+  let where = frame.where;
+  Assert.equal(where.source.actor, source.actor);
+  Assert.equal(where.line, location.line);
+  Assert.equal(where.column, 6);
 
-    let variables = frame.environment.bindings.variables;
-    Assert.equal(variables.a.value.type, "undefined");
-    Assert.equal(variables.b.value.type, "undefined");
-    Assert.equal(variables.c.value.type, "undefined");
+  let variables = frame.environment.bindings.variables;
+  Assert.equal(variables.a.value.type, "undefined");
+  Assert.equal(variables.b.value.type, "undefined");
+  Assert.equal(variables.c.value.type, "undefined");
 
-    await resume(threadClient);
-    await close(client);
-
-    do_test_finished();
-  };
+  await resume(threadClient);
+  await close(client);
+  do_test_finished();
 }
new file mode 100644
--- /dev/null
+++ b/devtools/server/tests/unit/test_setBreakpoint-at-the-end-of-a-line.js
@@ -0,0 +1,62 @@
+"use strict";
+
+var SOURCE_URL = getFileUrl("setBreakpoint-on-column.js");
+
+async function run_test() {
+  do_test_pending();
+
+  DebuggerServer.registerModule("xpcshell-test/testactors");
+  DebuggerServer.init(() => true);
+
+  let global = createTestGlobal("test");
+  DebuggerServer.addTestGlobal(global);
+
+  let client = new DebuggerClient(DebuggerServer.connectPipe());
+  await connect(client);
+
+  let { tabs } = await listTabs(client);
+  let tab = findTab(tabs, "test");
+  let [, tabClient] = await attachTab(client, tab);
+  let [, threadClient] = await attachThread(tabClient);
+  await resume(threadClient);
+
+  let promise = waitForNewSource(threadClient, SOURCE_URL);
+  loadSubScript(SOURCE_URL, global);
+  let { source } = await promise;
+  let sourceClient = threadClient.source(source);
+
+  let location = { line: 4, column: 42 };
+  let [packet, breakpointClient] = await setBreakpoint(
+    sourceClient,
+    location
+  );
+
+  Assert.ok(!packet.isPending);
+  Assert.equal(false, "actualLocation" in packet);
+
+  packet = await executeOnNextTickAndWaitForPause(function () {
+    Cu.evalInSandbox("f()", global);
+  }, client);
+
+  Assert.equal(packet.type, "paused");
+  let why = packet.why;
+  Assert.equal(why.type, "breakpoint");
+  Assert.equal(why.actors.length, 1);
+  Assert.equal(why.actors[0], breakpointClient.actor);
+
+  let frame = packet.frame;
+  let where = frame.where;
+  Assert.equal(where.source.actor, source.actor);
+  Assert.equal(where.line, location.line);
+  Assert.equal(where.column, 28);
+
+  let variables = frame.environment.bindings.variables;
+  Assert.equal(variables.a.value, 1);
+  Assert.equal(variables.b.value, 2);
+  Assert.equal(variables.c.value.type, "undefined");
+
+  await resume(threadClient);
+  await close(client);
+
+  do_test_finished();
+}
deleted file mode 100644
--- a/devtools/server/tests/unit/test_setBreakpoint-on-column-with-no-offsets-at-end-of-line.js
+++ /dev/null
@@ -1,39 +0,0 @@
-"use strict";
-
-var SOURCE_URL = getFileUrl("setBreakpoint-on-column-with-no-offsets-at-end-of-line.js");
-
-function run_test() {
-  return (async function () {
-    do_test_pending();
-
-    DebuggerServer.registerModule("xpcshell-test/testactors");
-    DebuggerServer.init(() => true);
-
-    let global = createTestGlobal("test");
-    DebuggerServer.addTestGlobal(global);
-
-    let client = new DebuggerClient(DebuggerServer.connectPipe());
-    await connect(client);
-
-    let { tabs } = await listTabs(client);
-    let tab = findTab(tabs, "test");
-    let [, tabClient] = await attachTab(client, tab);
-    let [, threadClient] = await attachThread(tabClient);
-    await resume(threadClient);
-
-    let promise = waitForNewSource(threadClient, SOURCE_URL);
-    loadSubScript(SOURCE_URL, global);
-    let { source } = await promise;
-    let sourceClient = threadClient.source(source);
-
-    let location = { line: 4, column: 23 };
-    let [packet, ] = await setBreakpoint(sourceClient, location);
-    Assert.ok(packet.isPending);
-    Assert.equal(false, "actualLocation" in packet);
-
-    Cu.evalInSandbox("f()", global);
-    await close(client);
-
-    do_test_finished();
-  })();
-}
--- a/devtools/server/tests/unit/test_stepping-01.js
+++ b/devtools/server/tests/unit/test_stepping-01.js
@@ -5,80 +5,77 @@
 "use strict";
 
 /**
  * Check basic step-over functionality.
  */
 
 var gDebuggee;
 var gClient;
-var gThreadClient;
 var gCallback;
 
 function run_test() {
+  do_test_pending();
   run_test_with_server(DebuggerServer, function () {
     run_test_with_server(WorkerDebuggerServer, do_test_finished);
   });
-  do_test_pending();
 }
 
 function run_test_with_server(server, callback) {
   gCallback = callback;
   initTestDebuggerServer(server);
-  gDebuggee = addTestGlobal("test-stack", server);
+  gDebuggee = addTestGlobal("test-stepping", server);
   gClient = new DebuggerClient(server.connectPipe());
-  gClient.connect().then(function () {
-    attachTestTabAndResume(gClient, "test-stack",
-                           function (response, tabClient, threadClient) {
-                             gThreadClient = threadClient;
-                             test_simple_stepping();
-                           });
-  });
+  gClient.connect(test_simple_stepping);
 }
 
-function test_simple_stepping() {
-  gThreadClient.addOneTimeListener("paused", function (event, packet) {
-    gThreadClient.addOneTimeListener("paused", function (event, packet) {
-      // Check the return value.
-      Assert.equal(packet.type, "paused");
-      Assert.equal(packet.frame.where.line, gDebuggee.line0 + 2);
-      Assert.equal(packet.why.type, "resumeLimit");
-      // Check that stepping worked.
-      Assert.equal(gDebuggee.a, undefined);
-      Assert.equal(gDebuggee.b, undefined);
+async function test_simple_stepping() {
+  const [attachResponse,, threadClient] = await attachTestTabAndResume(gClient,
+                                                                       "test-stepping");
+  ok(!attachResponse.error, "Should not get an error attaching");
 
-      gThreadClient.addOneTimeListener("paused", function (event, packet) {
-        // Check the return value.
-        Assert.equal(packet.type, "paused");
-        Assert.equal(packet.frame.where.line, gDebuggee.line0 + 3);
-        Assert.equal(packet.why.type, "resumeLimit");
-        // Check that stepping worked.
-        Assert.equal(gDebuggee.a, 1);
-        Assert.equal(gDebuggee.b, undefined);
+  dumpn("Evaluating test code and waiting for first debugger statement");
+  const dbgStmt = await executeOnNextTickAndWaitForPause(evaluateTestCode, gClient);
+  equal(dbgStmt.frame.where.line, 2, "Should be at debugger statement on line 2");
+  equal(gDebuggee.a, undefined);
+  equal(gDebuggee.b, undefined);
+
+  dumpn("Step Over to line 3");
+  const step1 = await stepOver(gClient, threadClient);
+  equal(step1.type, "paused");
+  equal(step1.why.type, "resumeLimit");
+  equal(step1.frame.where.line, 3);
+  equal(gDebuggee.a, undefined);
+  equal(gDebuggee.b, undefined);
 
-        gThreadClient.addOneTimeListener("paused", function (event, packet) {
-          // Check the return value.
-          Assert.equal(packet.type, "paused");
-          // When leaving a stack frame the line number doesn't change.
-          Assert.equal(packet.frame.where.line, gDebuggee.line0 + 3);
-          Assert.equal(packet.why.type, "resumeLimit");
-          // Check that stepping worked.
-          Assert.equal(gDebuggee.a, 1);
-          Assert.equal(gDebuggee.b, 2);
+  dumpn("Step Over to line 4");
+  const step3 = await stepOver(gClient, threadClient);
+  equal(step3.type, "paused");
+  equal(step3.why.type, "resumeLimit");
+  equal(step3.frame.where.line, 4);
+  equal(gDebuggee.a, 1);
+  equal(gDebuggee.b, undefined);
+
+  dumpn("Step Over to line 4 to leave the frame");
+  const step4 = await stepOver(gClient, threadClient);
+  equal(step4.type, "paused");
+  equal(step4.why.type, "resumeLimit");
+  equal(step4.frame.where.line, 4);
+  equal(gDebuggee.a, 1);
+  equal(gDebuggee.b, 2);
 
-          gThreadClient.resume(function () {
-            gClient.close().then(gCallback);
-          });
-        });
-        gThreadClient.stepOver();
-      });
-      gThreadClient.stepOver();
-    });
-    gThreadClient.stepOver();
-  });
+  finishClient(gClient, gCallback);
+}
 
+function evaluateTestCode() {
   /* eslint-disable */
-  gDebuggee.eval("var line0 = Error().lineNumber;\n" +
-                 "debugger;\n" +   // line0 + 1
-                 "var a = 1;\n" +  // line0 + 2
-                 "var b = 2;");    // line0 + 3
-  /* eslint-enable */
-}
+  Cu.evalInSandbox(
+    `                                   // 1
+    debugger;                           // 2
+    var a = 1;                          // 3
+    var b = 2;`,                        // 4
+    gDebuggee,
+    "1.8",
+    "test_stepping-01-test-code.js",
+    1
+  );
+  /* eslint-disable */
+}
\ No newline at end of file
--- a/devtools/server/tests/unit/test_stepping-02.js
+++ b/devtools/server/tests/unit/test_stepping-02.js
@@ -5,80 +5,77 @@
 "use strict";
 
 /**
  * Check basic step-in functionality.
  */
 
 var gDebuggee;
 var gClient;
-var gThreadClient;
 var gCallback;
 
 function run_test() {
+  do_test_pending();
   run_test_with_server(DebuggerServer, function () {
     run_test_with_server(WorkerDebuggerServer, do_test_finished);
   });
-  do_test_pending();
 }
 
 function run_test_with_server(server, callback) {
   gCallback = callback;
   initTestDebuggerServer(server);
-  gDebuggee = addTestGlobal("test-stack", server);
+  gDebuggee = addTestGlobal("test-stepping", server);
   gClient = new DebuggerClient(server.connectPipe());
-  gClient.connect().then(function () {
-    attachTestTabAndResume(gClient, "test-stack",
-                           function (response, tabClient, threadClient) {
-                             gThreadClient = threadClient;
-                             test_simple_stepping();
-                           });
-  });
+  gClient.connect(test_simple_stepping);
 }
 
-function test_simple_stepping() {
-  gThreadClient.addOneTimeListener("paused", function (event, packet) {
-    gThreadClient.addOneTimeListener("paused", function (event, packet) {
-      // Check the return value.
-      Assert.equal(packet.type, "paused");
-      Assert.equal(packet.frame.where.line, gDebuggee.line0 + 2);
-      Assert.equal(packet.why.type, "resumeLimit");
-      // Check that stepping worked.
-      Assert.equal(gDebuggee.a, undefined);
-      Assert.equal(gDebuggee.b, undefined);
+async function test_simple_stepping() {
+  const [attachResponse,, threadClient] = await attachTestTabAndResume(
+    gClient,
+    "test-stepping"
+  );
+
+  ok(!attachResponse.error, "Should not get an error attaching");
 
-      gThreadClient.addOneTimeListener("paused", function (event, packet) {
-        // Check the return value.
-        Assert.equal(packet.type, "paused");
-        Assert.equal(packet.frame.where.line, gDebuggee.line0 + 3);
-        Assert.equal(packet.why.type, "resumeLimit");
-        // Check that stepping worked.
-        Assert.equal(gDebuggee.a, 1);
-        Assert.equal(gDebuggee.b, undefined);
+  dumpn("Evaluating test code and waiting for first debugger statement");
+  const dbgStmt = await executeOnNextTickAndWaitForPause(evaluateTestCode, gClient);
+  equal(dbgStmt.frame.where.line, 2, "Should be at debugger statement on line 2");
+  equal(gDebuggee.a, undefined);
+  equal(gDebuggee.b, undefined);
+
+  const step1 = await stepIn(gClient, threadClient);
+  equal(step1.type, "paused");
+  equal(step1.why.type, "resumeLimit");
+  equal(step1.frame.where.line, 3);
+  equal(gDebuggee.a, undefined);
+  equal(gDebuggee.b, undefined);
 
-        gThreadClient.addOneTimeListener("paused", function (event, packet) {
-          // Check the return value.
-          Assert.equal(packet.type, "paused");
-          // When leaving a stack frame the line number doesn't change.
-          Assert.equal(packet.frame.where.line, gDebuggee.line0 + 3);
-          Assert.equal(packet.why.type, "resumeLimit");
-          // Check that stepping worked.
-          Assert.equal(gDebuggee.a, 1);
-          Assert.equal(gDebuggee.b, 2);
+  const step3 = await stepIn(gClient, threadClient);
+  equal(step3.type, "paused");
+  equal(step3.why.type, "resumeLimit");
+  equal(step3.frame.where.line, 4);
+  equal(gDebuggee.a, 1);
+  equal(gDebuggee.b, undefined);
+
+  const step4 = await stepIn(gClient, threadClient);
+  equal(step4.type, "paused");
+  equal(step4.why.type, "resumeLimit");
+  equal(step4.frame.where.line, 4);
+  equal(gDebuggee.a, 1);
+  equal(gDebuggee.b, 2);
 
-          gThreadClient.resume(function () {
-            gClient.close().then(gCallback);
-          });
-        });
-        gThreadClient.stepIn();
-      });
-      gThreadClient.stepIn();
-    });
-    gThreadClient.stepIn();
-  });
+  finishClient(gClient, gCallback);
+}
 
+function evaluateTestCode() {
   /* eslint-disable */
-  gDebuggee.eval("var line0 = Error().lineNumber;\n" +
-                 "debugger;\n" +   // line0 + 1
-                 "var a = 1;\n" +  // line0 + 2
-                 "var b = 2;");    // line0 + 3
-  /* eslint-enable */
+  Cu.evalInSandbox(
+    `                                   // 1
+    debugger;                           // 2
+    var a = 1;                          // 3
+    var b = 2;`,                        // 4
+    gDebuggee,
+    "1.8",
+    "test_stepping-01-test-code.js",
+    1
+  );
+  /* eslint-disable */
 }
--- a/devtools/server/tests/unit/test_stepping-03.js
+++ b/devtools/server/tests/unit/test_stepping-03.js
@@ -5,60 +5,62 @@
 "use strict";
 
 /**
  * Check basic step-out functionality.
  */
 
 var gDebuggee;
 var gClient;
-var gThreadClient;
 var gCallback;
 
 function run_test() {
   run_test_with_server(DebuggerServer, function () {
     run_test_with_server(WorkerDebuggerServer, do_test_finished);
   });
   do_test_pending();
 }
 
 function run_test_with_server(server, callback) {
   gCallback = callback;
   initTestDebuggerServer(server);
-  gDebuggee = addTestGlobal("test-stack", server);
+  gDebuggee = addTestGlobal("test-stepping", server);
   gClient = new DebuggerClient(server.connectPipe());
-  gClient.connect().then(function () {
-    attachTestTabAndResume(gClient, "test-stack",
-                           function (response, tabClient, threadClient) {
-                             gThreadClient = threadClient;
-                             test_simple_stepping();
-                           });
-  });
+  gClient.connect(test_simple_stepping);
 }
 
-function test_simple_stepping() {
-  gThreadClient.addOneTimeListener("paused", function (event, packet) {
-    gThreadClient.addOneTimeListener("paused", function (event, packet) {
-      // Check the return value.
-      Assert.equal(packet.type, "paused");
-      Assert.equal(packet.frame.where.line, gDebuggee.line0 + 5);
-      Assert.equal(packet.why.type, "resumeLimit");
-      // Check that stepping worked.
-      Assert.equal(gDebuggee.a, 1);
-      Assert.equal(gDebuggee.b, 2);
+async function test_simple_stepping() {
+  const [attachResponse,, threadClient] = await attachTestTabAndResume(gClient,
+                                                                       "test-stepping");
+  ok(!attachResponse.error, "Should not get an error attaching");
+
+  dumpn("Evaluating test code and waiting for first debugger statement");
+  await executeOnNextTickAndWaitForPause(evaluateTestCode, gClient);
+
+  const step1 = await stepOut(gClient, threadClient);
+  equal(step1.type, "paused");
+  equal(step1.frame.where.line, 6);
+  equal(step1.why.type, "resumeLimit");
+
+  equal(gDebuggee.a, 1);
+  equal(gDebuggee.b, 2);
+
+  finishClient(gClient, gCallback);
+}
 
-      gThreadClient.resume(function () {
-        gClient.close().then(gCallback);
-      });
-    });
-    gThreadClient.stepOut();
-  });
-
+function evaluateTestCode() {
   /* eslint-disable */
-  gDebuggee.eval("var line0 = Error().lineNumber;\n" +
-                 "function f() {\n" + // line0 + 1
-                 "  debugger;\n" +    // line0 + 2
-                 "  this.a = 1;\n" +  // line0 + 3
-                 "  this.b = 2;\n" +  // line0 + 4
-                 "}\n" +              // line0 + 5
-                 "f();\n");           // line0 + 6
-  /* eslint-enable */
-}
+  Cu.evalInSandbox(
+    `                                   // 1
+    function f() {                      // 2
+      debugger;                         // 3
+      this.a = 1;                       // 4
+      this.b = 2;                       // 5
+    }                                   // 6
+    f();                                // 7
+    `,                                  // 8
+    gDebuggee,
+    "1.8",
+    "test_stepping-01-test-code.js",
+    1
+  );
+  /* eslint-disable */
+}
\ No newline at end of file
--- a/devtools/server/tests/unit/test_stepping-04.js
+++ b/devtools/server/tests/unit/test_stepping-04.js
@@ -5,71 +5,73 @@
 "use strict";
 
 /**
  * Check that stepping over a function call does not pause inside the function.
  */
 
 var gDebuggee;
 var gClient;
-var gThreadClient;
 var gCallback;
 
 function run_test() {
   run_test_with_server(DebuggerServer, function () {
     run_test_with_server(WorkerDebuggerServer, do_test_finished);
   });
   do_test_pending();
 }
 
 function run_test_with_server(server, callback) {
   gCallback = callback;
   initTestDebuggerServer(server);
-  gDebuggee = addTestGlobal("test-stack", server);
+  gDebuggee = addTestGlobal("test-stepping", server);
   gClient = new DebuggerClient(server.connectPipe());
-  gClient.connect().then(function () {
-    attachTestTabAndResume(gClient, "test-stack",
-                           function (response, tabClient, threadClient) {
-                             gThreadClient = threadClient;
-                             test_simple_stepping();
-                           });
-  });
+  gClient.connect(test_simple_stepping);
 }
 
-function test_simple_stepping() {
-  gThreadClient.addOneTimeListener("paused", function (event, packet) {
-    gThreadClient.addOneTimeListener("paused", function (event, packet) {
-      // Check the return value.
-      Assert.equal(packet.type, "paused");
-      Assert.equal(packet.frame.where.line, gDebuggee.line0 + 5);
-      Assert.equal(packet.why.type, "resumeLimit");
-      // Check that stepping worked.
-      Assert.equal(gDebuggee.a, undefined);
-      Assert.equal(gDebuggee.b, undefined);
+async function test_simple_stepping() {
+  const [attachResponse,, threadClient] = await attachTestTabAndResume(
+    gClient,
+    "test-stepping"
+  );
+
+  ok(!attachResponse.error, "Should not get an error attaching");
 
-      gThreadClient.addOneTimeListener("paused", function (event, packet) {
-        // Check the return value.
-        Assert.equal(packet.type, "paused");
-        Assert.equal(packet.frame.where.line, gDebuggee.line0 + 6);
-        Assert.equal(packet.why.type, "resumeLimit");
-        // Check that stepping worked.
-        Assert.equal(gDebuggee.a, 1);
-        Assert.equal(gDebuggee.b, undefined);
+  dumpn("Evaluating test code and waiting for first debugger statement");
+  await executeOnNextTickAndWaitForPause(evaluateTestCode, gClient);
+
+  dumpn("Step Over to f()");
+  const step1 = await stepOver(gClient, threadClient);
+  equal(step1.type, "paused");
+  equal(step1.why.type, "resumeLimit");
+  equal(step1.frame.where.line, 6);
+  equal(gDebuggee.a, undefined);
+  equal(gDebuggee.b, undefined);
 
-        gThreadClient.resume(function () {
-          gClient.close().then(gCallback);
-        });
-      });
-      gThreadClient.stepOver();
-    });
-    gThreadClient.stepOver();
-  });
+  dumpn("Step Over f()");
+  const step2 = await stepOver(gClient, threadClient);
+  equal(step2.type, "paused");
+  equal(step2.frame.where.line, 7);
+  equal(step2.why.type, "resumeLimit");
+  equal(gDebuggee.a, 1);
+  equal(gDebuggee.b, undefined);
 
+  finishClient(gClient, gCallback);
+}
+
+function evaluateTestCode() {
   /* eslint-disable */
-  gDebuggee.eval("var line0 = Error().lineNumber;\n" +
-                 "function f() {\n" + // line0 + 1
-                 "  this.a = 1;\n" +  // line0 + 2
-                 "}\n" +              // line0 + 3
-                 "debugger;\n" +      // line0 + 4
-                 "f();\n" +           // line0 + 5
-                 "let b = 2;\n");     // line0 + 6
-  /* eslint-enable */
+  Cu.evalInSandbox(
+    `                                   // 1
+    function f() {                      // 2
+      this.a = 1;                       // 3
+    }                                   // 4
+    debugger;                           // 5
+    f();                                // 6
+    let b = 2;                          // 7
+    `,                                  // 8
+    gDebuggee,
+    "1.8",
+    "test_stepping-01-test-code.js",
+    1
+  );
+  /* eslint-disable */
 }
--- a/devtools/server/tests/unit/test_stepping-05.js
+++ b/devtools/server/tests/unit/test_stepping-05.js
@@ -7,95 +7,81 @@
 /**
  * Make sure that stepping in the last statement of the last frame doesn't
  * cause an unexpected pause, when another JS frame is pushed on the stack
  * (bug 785689).
  */
 
 var gDebuggee;
 var gClient;
-var gThreadClient;
 var gCallback;
 
 function run_test() {
   run_test_with_server(DebuggerServer, function () {
     run_test_with_server(WorkerDebuggerServer, do_test_finished);
   });
   do_test_pending();
 }
-
 function run_test_with_server(server, callback) {
   gCallback = callback;
   initTestDebuggerServer(server);
-  gDebuggee = addTestGlobal("test-stack", server);
+  gDebuggee = addTestGlobal("test-stepping", server);
   gClient = new DebuggerClient(server.connectPipe());
-  gClient.connect().then(function () {
-    attachTestTabAndResume(gClient, "test-stack",
-                           function (response, tabClient, threadClient) {
-                             gThreadClient = threadClient;
-                             test_stepping_last();
-                           });
+  gClient.connect(test_simple_stepping);
+}
+
+async function test_simple_stepping() {
+  const [attachResponse,, threadClient] = await attachTestTabAndResume(
+    gClient,
+    "test-stepping"
+  );
+
+  ok(!attachResponse.error, "Should not get an error attaching");
+
+  dumpn("Evaluating test code and waiting for first debugger statement");
+  await executeOnNextTickAndWaitForPause(evaluateTestCode, gClient);
+
+  const step1 = await stepIn(gClient, threadClient);
+  equal(step1.type, "paused");
+  equal(step1.frame.where.line, 3);
+  equal(step1.why.type, "resumeLimit");
+  equal(gDebuggee.a, undefined);
+  equal(gDebuggee.b, undefined);
+
+  const step2 = await stepIn(gClient, threadClient);
+  equal(step2.type, "paused");
+  equal(step2.frame.where.line, 4);
+  equal(step2.why.type, "resumeLimit");
+  equal(gDebuggee.a, 1);
+  equal(gDebuggee.b, undefined);
+
+  const step3 = await stepIn(gClient, threadClient);
+  equal(step3.type, "paused");
+  equal(step3.frame.where.line, 4);
+  equal(step3.why.type, "resumeLimit");
+  equal(gDebuggee.a, 1);
+  equal(gDebuggee.b, 2);
+
+  threadClient.stepIn(() => {
+    threadClient.addOneTimeListener("paused", (event, packet) => {
+      equal(packet.type, "paused");
+      // Before fixing bug 785689, the type was resumeLimit.
+      equal(packet.why.type, "debuggerStatement");
+      finishClient(gClient, gCallback);
+    });
+    gDebuggee.eval("debugger;");
   });
 }
 
-function test_stepping_last() {
-  gThreadClient.addOneTimeListener("paused", function (event, packet) {
-    gThreadClient.addOneTimeListener("paused", function (event, packet) {
-      // Check the return value.
-      Assert.equal(packet.type, "paused");
-      Assert.equal(packet.frame.where.line, gDebuggee.line0 + 2);
-      Assert.equal(packet.why.type, "resumeLimit");
-      // Check that stepping worked.
-      Assert.equal(gDebuggee.a, undefined);
-      Assert.equal(gDebuggee.b, undefined);
-
-      gThreadClient.addOneTimeListener("paused", function (event, packet) {
-        // Check the return value.
-        Assert.equal(packet.type, "paused");
-        Assert.equal(packet.frame.where.line, gDebuggee.line0 + 3);
-        Assert.equal(packet.why.type, "resumeLimit");
-        // Check that stepping worked.
-        Assert.equal(gDebuggee.a, 1);
-        Assert.equal(gDebuggee.b, undefined);
-
-        gThreadClient.addOneTimeListener("paused", function (event, packet) {
-          // Check the return value.
-          Assert.equal(packet.type, "paused");
-          // When leaving a stack frame the line number doesn't change.
-          Assert.equal(packet.frame.where.line, gDebuggee.line0 + 3);
-          Assert.equal(packet.why.type, "resumeLimit");
-          // Check that stepping worked.
-          Assert.equal(gDebuggee.a, 1);
-          Assert.equal(gDebuggee.b, 2);
-
-          gThreadClient.stepIn(function () {
-            test_next_pause();
-          });
-        });
-        gThreadClient.stepIn();
-      });
-      gThreadClient.stepIn();
-    });
-    gThreadClient.stepIn();
-  });
-
+function evaluateTestCode() {
   /* eslint-disable */
-  gDebuggee.eval("var line0 = Error().lineNumber;\n" +
-                 "debugger;\n" +   // line0 + 1
-                 "var a = 1;\n" +  // line0 + 2
-                 "var b = 2;");    // line0 + 3
-  /* eslint-enable */
+  Cu.evalInSandbox(
+    `                                   // 1                       
+    debugger;                           // 2
+    var a = 1;                          // 3
+    var b = 2;`,                        // 4
+    gDebuggee,
+    "1.8",
+    "test_stepping-05-test-code.js",
+    1
+  );
+  /* eslint-disable */
 }
-
-function test_next_pause() {
-  gThreadClient.addOneTimeListener("paused", function (event, packet) {
-    // Check the return value.
-    Assert.equal(packet.type, "paused");
-    // Before fixing bug 785689, the type was resumeLimit.
-    Assert.equal(packet.why.type, "debuggerStatement");
-
-    gThreadClient.resume(function () {
-      gClient.close().then(gCallback);
-    });
-  });
-
-  gDebuggee.eval("debugger;");
-}
--- a/devtools/server/tests/unit/test_stepping-06.js
+++ b/devtools/server/tests/unit/test_stepping-06.js
@@ -35,68 +35,76 @@ function run_test_with_server(server, ca
         // transport and share a stack) which causes the test to fail.
         Services.tm.dispatchToMainThread({
           run: test_simple_stepping
         });
       });
   });
 }
 
-function test_simple_stepping() {
-  gThreadClient.addOneTimeListener("paused", function (event, packet) {
-    gThreadClient.addOneTimeListener("paused", function (event, packet) {
-      // Check that the return value is 10.
-      Assert.equal(packet.type, "paused");
-      Assert.equal(packet.frame.where.line, gDebuggee.line0 + 5);
-      Assert.equal(packet.why.type, "resumeLimit");
-      Assert.equal(packet.why.frameFinished.return, 10);
+async function test_simple_stepping() {
+  await executeOnNextTickAndWaitForPause(evaluateTestCode, gClient);
+
+  const step1 = await stepOut(gClient, gThreadClient);
+  equal(step1.type, "paused");
+  equal(step1.frame.where.line, 6);
+  equal(step1.why.type, "resumeLimit");
+  equal(step1.why.frameFinished.return, 10);
 
-      gThreadClient.addOneTimeListener("paused", function (event, packet) {
-        gThreadClient.addOneTimeListener("paused", function (event, packet) {
-          // Check that the return value is undefined.
-          Assert.equal(packet.type, "paused");
-          Assert.equal(packet.frame.where.line, gDebuggee.line0 + 8);
-          Assert.equal(packet.why.type, "resumeLimit");
-          Assert.equal(packet.why.frameFinished.return.type, "undefined");
+  gThreadClient.resume();
+  const step2 = await waitForPause(gThreadClient);
+  equal(step2.type, "paused");
+  equal(step2.frame.where.line, 8);
+  equal(step2.why.type, "debuggerStatement");
 
-          gThreadClient.addOneTimeListener("paused", function (event, packet) {
-            gThreadClient.addOneTimeListener("paused", function (event, packet) {
-              // Check that the exception was thrown.
-              Assert.equal(packet.type, "paused");
-              Assert.equal(packet.frame.where.line, gDebuggee.line0 + 11);
-              Assert.equal(packet.why.type, "resumeLimit");
-              Assert.equal(packet.why.frameFinished.throw, "ah");
+  gThreadClient.stepOut();
+  const step3 = await waitForPause(gThreadClient);
+  equal(step3.type, "paused");
+  equal(step3.frame.where.line, 9);
+  equal(step3.why.type, "resumeLimit");
+  equal(step3.why.frameFinished.return.type, "undefined");
+
+  gThreadClient.resume();
+  const step4 = await waitForPause(gThreadClient);
+
+  equal(step4.type, "paused");
+  equal(step4.frame.where.line, 11);
 
-              gThreadClient.resume(function () {
-                gClient.close().then(gCallback);
-              });
-            });
-            gThreadClient.stepOut();
-          });
-          gThreadClient.resume();
-        });
-        gThreadClient.stepOut();
-      });
-      gThreadClient.resume();
-    });
-    gThreadClient.stepOut();
-  });
+  gThreadClient.stepOut();
+  const step5 = await waitForPause(gThreadClient);
+  equal(step5.type, "paused");
+  equal(step5.frame.where.line, 12);
+  equal(step5.why.type, "resumeLimit");
+  equal(step5.why.frameFinished.throw, "ah");
 
+  finishClient(gClient, gCallback);
+}
+
+function evaluateTestCode() {
   /* eslint-disable */
-  gDebuggee.eval("var line0 = Error().lineNumber;\n" +
-                 "function f() {\n" +                   // line0 + 1
-                 "  debugger;\n" +                      // line0 + 2
-                 "  var a = 10;\n" +                    // line0 + 3
-                 "  return a;\n" +                      // line0 + 4
-                 "}\n" +                                // line0 + 5
-                 "function g() {\n" +                   // line0 + 6
-                 "  debugger;\n" +                      // line0 + 7
-                 "}\n" +                                // line0 + 8
-                 "function h() {\n" +                   // line0 + 9
-                 "  debugger;\n" +                      // line0 + 10
-                 "  throw 'ah';\n" +                    // line0 + 11
-                 "  return 2;\n" +                      // line0 + 12
-                 "}\n" +                                // line0 + 13
-                 "f();\n" +                             // line0 + 14
-                 "g();\n" +                             // line0 + 15
-                 "try { h() } catch (ex) { };\n");      // line0 + 16
-    /* eslint-enable */
+  Cu.evalInSandbox(
+    `                                   //  1
+    function f() {                      //  2
+      debugger;                         //  3
+      var a = 10;                       //  4
+      return a;                         //  5
+    }                                   //  6
+    function g() {                      //  7
+      debugger;                         //  8
+    }                                   //  9
+    function h() {                      // 10
+      debugger;                         // 11
+      throw 'ah';                       // 12
+      return 2;                         // 13
+    }                                   // 14
+    f()                                 // 15
+    g()                                 // 16
+    try {                               // 17
+      h();                              // 18
+    } catch (ex) { };                   // 19
+    `,                                  // 20
+    gDebuggee,
+    "1.8",
+    "test_stepping-07-test-code.js",
+    1
+  );
+  /* eslint-enable */
 }
--- a/devtools/server/tests/unit/test_stepping-07.js
+++ b/devtools/server/tests/unit/test_stepping-07.js
@@ -21,19 +21,22 @@ function run_test() {
 function run_test_with_server(server, callback) {
   gCallback = callback;
   initTestDebuggerServer(server);
   gDebuggee = addTestGlobal("test-stepping", server);
   gClient = new DebuggerClient(server.connectPipe());
   gClient.connect(testSteppingAndReturns);
 }
 
-const testSteppingAndReturns = async function () {
-  const [attachResponse,, threadClient] = await attachTestTabAndResume(gClient,
-                                                                       "test-stepping");
+async function testSteppingAndReturns() {
+  const [attachResponse,, threadClient] = await attachTestTabAndResume(
+    gClient,
+    "test-stepping"
+  );
+
   ok(!attachResponse.error, "Should not get an error attaching");
 
   dumpn("Evaluating test code and waiting for first debugger statement");
   const dbgStmt1 = await executeOnNextTickAndWaitForPause(evaluateTestCode, gClient);
   equal(dbgStmt1.frame.where.line, 3,
         "Should be at debugger statement on line 3");
 
   dumpn("Testing stepping with implicit return");
@@ -59,17 +62,17 @@ const testSteppingAndReturns = async fun
   const step4 = await stepOver(gClient, threadClient);
   equal(step4.frame.where.line, 15, "Should step out of the function from line 15");
   // This step is a bit funny, see bug 1013219 for details.
   const step5 = await stepOver(gClient, threadClient);
   equal(step5.frame.where.line, 15, "Should step out of the function from line 15");
   ok(step5.why.frameFinished, "This should be the explicit function return");
 
   finishClient(gClient, gCallback);
-};
+}
 
 function evaluateTestCode() {
   /* eslint-disable */
   Cu.evalInSandbox(
     `                                   //  1
     function implicitReturn() {         //  2
       debugger;                         //  3
       if (this.someUndefinedProperty) { //  4
--- a/devtools/server/tests/unit/xpcshell.ini
+++ b/devtools/server/tests/unit/xpcshell.ini
@@ -16,17 +16,16 @@ support-files =
   registertestactors-02.js
   registertestactors-03.js
   sourcemapped.js
   testactors.js
   hello-actor.js
   setBreakpoint-on-column.js
   setBreakpoint-on-column-in-gcd-script.js
   setBreakpoint-on-column-with-no-offsets.js
-  setBreakpoint-on-column-with-no-offsets-at-end-of-line.js
   setBreakpoint-on-column-with-no-offsets-in-gcd-script.js
   setBreakpoint-on-line.js
   setBreakpoint-on-line-in-gcd-script.js
   setBreakpoint-on-line-with-multiple-offsets.js
   setBreakpoint-on-line-with-multiple-statements.js
   setBreakpoint-on-line-with-no-offsets.js
   setBreakpoint-on-line-with-no-offsets-in-gcd-script.js
   addons/web-extension/manifest.json
@@ -218,19 +217,19 @@ reason = bug 937197
 [test_client_request.js]
 [test_symbols-01.js]
 [test_symbols-02.js]
 [test_get-executable-lines.js]
 [test_get-executable-lines-source-map.js]
 [test_xpcshell_debugging.js]
 support-files = xpcshell_debugging_script.js
 [test_setBreakpoint-at-the-beginning-of-a-line.js]
+[test_setBreakpoint-at-the-end-of-a-line.js]
 [test_setBreakpoint-on-column.js]
 [test_setBreakpoint-on-column-in-gcd-script.js]
-[test_setBreakpoint-on-column-with-no-offsets-at-end-of-line.js]
 [test_setBreakpoint-on-line.js]
 [test_setBreakpoint-on-line-in-gcd-script.js]
 [test_setBreakpoint-on-line-with-multiple-offsets.js]
 [test_setBreakpoint-on-line-with-multiple-statements.js]
 [test_setBreakpoint-on-line-with-no-offsets.js]
 [test_setBreakpoint-on-line-with-no-offsets-in-gcd-script.js]
 [test_safe-getter.js]
 [test_client_close.js]
--- a/layout/xul/reftest/reftest.list
+++ b/layout/xul/reftest/reftest.list
@@ -1,9 +1,9 @@
 fails-if(Android) == textbox-multiline-noresize.xul textbox-multiline-ref.xul # reference is blank on Android (due to no native theme support?)
 != textbox-multiline-resize.xul textbox-multiline-ref.xul
 == popup-explicit-size.xul popup-explicit-size-ref.xul
-random-if(Android||winWidget) fuzzy-if(webrender,128-128,168-168) == image-size.xul image-size-ref.xul # Bug 1426797
+random-if(Android) fuzzy-if(webrender,128-128,168-168) == image-size.xul image-size-ref.xul
 == image-scaling-min-height-1.xul image-scaling-min-height-1-ref.xul
 == textbox-text-transform.xul textbox-text-transform-ref.xul
 
 == checkbox-dynamic-change.xul checkbox-dynamic-change-ref.xul
 == radio-dynamic-change.xul radio-dynamic-change-ref.xul
--- a/layout/xul/tree/crashtests/crashtests.list
+++ b/layout/xul/tree/crashtests/crashtests.list
@@ -1,12 +1,12 @@
 load 307298-1.xul
 load 309732-1.xul
 load 309732-2.xul
-asserts-if(winWidget,0-1) load 366583-1.xul # Bug 1428087
+load 366583-1.xul
 load 380217-1.xul
 load 382444-1.html
 load 391178-1.xhtml
 load 391178-2.xul
 load 393665-1.xul
 load 399227-1.xul
 load 399227-2.xul
 load 399692-1.xhtml