Report the APZ subtest in assertions written in apz_test_utils.js
Categories
(Core :: Panning and Zooming, defect)
Tracking
()
People
(Reporter: botond, Assigned: botond)
Details
Attachments
(1 obsolete file)
Most APZ mochitests are written as subtests that run in their own windows.
It's useful for assertions to print both the name of the test and the name of the subtest. To accomplish this, we populate the subtest window's global scope with assertion functions like ok()
, is()
, etc. that forward to the corresponding SimpleTest
functions but add in the subtest name.
Then, in subtest code, we call these wrappers via ok()
etc. (as opposed to SimpleTest.ok()
).
However, there are some assertions written in helper functions in apz_test_utils.js
(like this one) that use SimpleTest.ok()
, and therefore do not print the subtest name when invoked in a subtest context.
I tried changing these to plain ok()
in this patch, but that breaks cases where these helpers are used outside of subtest context (where ok
is not present in global scope).
Possible options:
- Populate the global scope with
ok()
etc. even in toplevel tests. We'd have to find a place to do this that's called by all tests. - Rewrite affected toplevel tests to be subtests. This may be desirable for uniformity reasons, though "this function can only be called in a subtest invoked via
runSubtestsSeriallyInFreshWindows()
" is an odd constraint to impose on the helper functions inapz_test_utils.js
. - Do nothing and live with the subtest name not being present in some assertions.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 1•4 years ago
|
||
Similarly for SimpleTest.is().
This ensures that in subtests, the wrapper function that also displays
the subtest name is used.
Updated•4 years ago
|
Assignee | ||
Comment 2•4 years ago
|
||
(In reply to Botond Ballo [:botond] from comment #0)
- Do nothing and live with the subtest name not being present in some assertions.
Based on discussion with Kats, we'll go with this option.
Updated•4 years ago
|
Description
•