Closed Bug 1669362 Opened 4 years ago Closed 4 years ago

Report the APZ subtest in assertions written in apz_test_utils.js

Categories

(Core :: Panning and Zooming, defect)

defect

Tracking

()

RESOLVED WONTFIX

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 in apz_test_utils.js.
  • Do nothing and live with the subtest name not being present in some assertions.
Severity: -- → S4

Similarly for SimpleTest.is().

This ensures that in subtests, the wrapper function that also displays
the subtest name is used.

Assignee: nobody → botond
Status: NEW → ASSIGNED

(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.

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
Attachment #9179747 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: