Closed Bug 1544051 Opened 2 years ago Closed 2 years ago

Automatically load AddTask.js in mochitest-chrome and mochitest-plain through SimpleTest.js


(Testing :: Mochitest, task)

Version 3
Not set


(firefox68 fixed)

Tracking Status
firefox68 --- fixed


(Reporter: bgrins, Assigned: bgrins)




(5 files)

Right now to use add_task you have to explicitly include this file ( with:

  • mochitest-chrome: <script src="chrome://mochikit/content/tests/SimpleTest/AddTask.js"></script>
  • mochitest-plain: <script src="/tests/SimpleTest/AddTask.js"></script>

I think we should be including this anywhere that loads SimpleTest.js because:

  1. add_task is a nicer way to work with tests (it automatically calls SimpleTest.waitForExplicitFinish, waits for load, is async by default)
  2. the script doesn't have any side effects unless called
  3. it's available by default in other suites (mochitest-browser, xpcshell)

My proposal is to move the contents of AddTask.js into SimpleTest.js and then remove the separate file and any references to it.

Attached file

Script for removing <script> tags referencing AddTask.js

Haven't heard any feedback in, so I'm going to push up some patches to make this change.

(In reply to Brian Grinstead [:bgrins] from comment #2)

Haven't heard any feedback in, so I'm going to push up some patches to make this change.

Joel, are you a good reviewer for this change, or could you recommend someone if not? I see you initially reviewed SpawnTask.js before it was renamed to AddTask.js:

Flags: needinfo?(jmaher)

:ahal would be a good reviewer for this

Flags: needinfo?(jmaher)
Assignee: nobody → bgrinstead
Pushed by
Part 1 - Move add_task into SimpleTest.js r=ahal
Part 2 - Remove some references to AddTask.js that aren't caught by the script in part 3 r=ahal
Part 3 - Scripted change to remove references to AddTask.js r=ahal
Part 4 - Remove AddTask.js r=ahal
You need to log in before you can comment on or make changes to this bug.