some xpcshell tests broken by record

RESOLVED FIXED in Firefox 65

Status

defect
P1
normal
RESOLVED FIXED
8 months ago
8 months ago

People

(Reporter: mixedpuppy, Assigned: mixedpuppy)

Tracking

unspecified
mozilla65
Dependency tree / graph
Bug Flags:
qe-verify -

Firefox Tracking Flags

(firefox65 fixed)

Details

Attachments

(1 attachment)

./mach xpcshell-test toolkit/components/extensions/test/xpcshell/test_ext_contentscript_context.js

Produces a lot of:

JavaScript error: resource://testing-common/ContentTask.jsm, line 116: TypeError: ContentTask._testScope.record is not a function
Thanks for filing! It looks like for ContentTask running in xpc-shell tests, the "testScope" available is the Assert class from Assert.jsm and is not coming from browser-test.js

Inaccurate comment in ContentTask.jsm: https://searchfox.org/mozilla-central/rev/6e0e603f4852b8e571e5b8ae133e772b18b6016e/testing/mochitest/BrowserTestUtils/ContentTask.jsm#38-39

Copy Assert.jsm methods in xpcshell test scope: https://searchfox.org/mozilla-central/rev/6e0e603f4852b8e571e5b8ae133e772b18b6016e/testing/xpcshell/head.js#513

The interesting thing is that todo and todo_is are also not available in this scope, so the following lines will fail in xpcshell tests:
https://searchfox.org/mozilla-central/rev/6e0e603f4852b8e571e5b8ae133e772b18b6016e/testing/mochitest/BrowserTestUtils/ContentTask.jsm#119-123
Julian, do you want to take this?
Flags: needinfo?(jdescottes)
I wrote my comment before seeing your patch (thanks for working on it), but I'm fine with landing this to fix the issue. I think we should have a follow-up to clarify what can be "testScope" in ContentTask.jsm, but that can wait. So if Mark is ok with your patch we should land it.
Flags: needinfo?(jdescottes)
Assignee: nobody → mixedpuppy
Priority: -- → P1
See Also: → 1506134
I've posted a followup, bug 1506134.
Pushed by mixedpuppy@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/00c7004a24da
add record to xpcshell tests for use in extension tests, r=Standard8
https://hg.mozilla.org/mozilla-central/rev/00c7004a24da
Status: NEW → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
Flags: qe-verify-
You need to log in before you can comment on or make changes to this bug.