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

RESOLVED FIXED in Firefox 68

Status

task
RESOLVED FIXED
2 months ago
2 months ago

People

(Reporter: bgrins, Assigned: bgrins)

Tracking

Version 3
mozilla68
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox68 fixed)

Details

Attachments

(5 attachments)

Assignee

Description

2 months ago

Right now to use add_task you have to explicitly include this file (https://searchfox.org/mozilla-central/source/testing/mochitest/tests/SimpleTest/AddTask.js) 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.

Assignee

Updated

2 months ago
Type: defect → task
Assignee

Updated

2 months ago
Depends on: 1544322
Assignee

Comment 1

2 months ago

Script for removing <script> tags referencing AddTask.js

Assignee

Comment 2

2 months ago

Haven't heard any feedback in https://groups.google.com/d/msg/mozilla.dev.platform/PqL0OC2C-90/15_zAj7_CgAJ, so I'm going to push up some patches to make this change.

Assignee

Comment 7

2 months ago

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

Haven't heard any feedback in https://groups.google.com/d/msg/mozilla.dev.platform/PqL0OC2C-90/15_zAj7_CgAJ, 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: https://hg.mozilla.org/mozilla-central/log/22acceec0478/testing/mochitest/tests/SimpleTest/SpawnTask.js.

Flags: needinfo?(jmaher)

:ahal would be a good reviewer for this

Flags: needinfo?(jmaher)
Assignee

Updated

2 months ago
Assignee: nobody → bgrinstead
Status: NEW → ASSIGNED

Comment 9

2 months ago
Pushed by bgrinstead@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/77269915d66a
Part 1 - Move add_task into SimpleTest.js r=ahal
https://hg.mozilla.org/integration/autoland/rev/480e15689b61
Part 2 - Remove some references to AddTask.js that aren't caught by the script in part 3 r=ahal
https://hg.mozilla.org/integration/autoland/rev/c83490ca7185
Part 3 - Scripted change to remove references to AddTask.js r=ahal
https://hg.mozilla.org/integration/autoland/rev/dfe0b0d0827e
Part 4 - Remove AddTask.js r=ahal
You need to log in before you can comment on or make changes to this bug.