Closed Bug 1512152 Opened 6 years ago Closed 5 years ago

Migrate all test_setBreakpoint xpcshell test to use threadClientTest helper

Categories

(DevTools :: Debugger, task, P1)

task

Tracking

(firefox72 fixed)

RESOLVED FIXED
Firefox 72
Tracking Status
firefox72 --- fixed

People

(Reporter: ochameau, Assigned: bhackett1024)

References

(Blocks 3 open bugs)

Details

(Keywords: good-first-bug, Whiteboard: dt-fission-reserve)

Attachments

(1 file)

All these tests are having 14 setup lines that are redundant with the existing threadClientTest helper. I'm looking forward getting rid of these repetition as it includes a call to listTabs which I'll have to refactor in bug 1508285.
Whiteboard: dt-fission
Blocks: dbg-server
Keywords: good-first-bug
Type: enhancement → task
Priority: P2 → P3
Priority: P3 → P2
Blocks: dbg-protocol-js
No longer blocks: dbg-fission
Priority: P2 → P3
Whiteboard: dt-fission → dt-fission-reserve

Bug 1512220 refactored all the test_setBreakpoint tests, but there is many xpcshell tests which are not using the threadFrontTest helper and are duplicating a few lines in each test.
Here is an helpful query to find them out:
https://searchfox.org/mozilla-central/search?q=symbol:%23initTestDebuggerServer&redirect=false

The helper is here:
https://searchfox.org/mozilla-central/rev/8b7aa8af652f87d39349067a5bc9c0256bf6dedc/devtools/server/tests/unit/head_dbg.js#868-944

For example this test:
https://searchfox.org/mozilla-central/rev/8b7aa8af652f87d39349067a5bc9c0256bf6dedc/devtools/server/tests/unit/test_blackboxing-01.js#14-29

function run_test() {
  initTestDebuggerServer();
  gDebuggee = addTestGlobal("test-black-box");
  gClient = new DebuggerClient(DebuggerServer.connectPipe());
  gClient.connect().then(function() {
    attachTestTabAndResume(gClient, "test-black-box", function(
      response,
      targetFront,
      threadFront
    ) {
      gThreadFront = threadFront;
      testBlackBox();
    });
  });
  do_test_pending();
}

Could most likely be written like this one:
https://searchfox.org/mozilla-central/rev/8b7aa8af652f87d39349067a5bc9c0256bf6dedc/devtools/server/tests/unit/test_breakpoint-01.js#11-13

add_task(
  threadFrontTest(async ({ threadFront, debuggee }) => {
    (async () => {
      await testBlockBox(threadFront);
    })
));
Assignee: poirot.alex → nobody
Assignee: nobody → bhackett1024
Status: NEW → ASSIGNED
Priority: P3 → P1
Pushed by bhackett@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6b3e85d6a39f Use threadFrontTest instead of initTestDebuggerServer when possible, r=ochameau.
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 72
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: