devtools/client/debugger/test/mochitest/browser_dbg_instruments-pane-collapse_keyboard.js fails after bug 1193394

ASSIGNED
Assigned to

Status

()

Firefox
Developer Tools
ASSIGNED
4 days ago
2 days ago

People

(Reporter: arai, Assigned: arai)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

4 days ago
https://treeherder.mozilla.org/#/jobs?repo=try&revision=c7b7ba9086f5524823ea95f717f4bfbe0430313a&filter-searchStr=dt&selectedJob=154669287
> TEST-UNEXPECTED-FAIL | devtools/client/debugger/test/mochitest/browser_dbg_instruments-pane-collapse_keyboard.js | The instruments panel is in the collapsed state -

https://searchfox.org/mozilla-central/rev/7476b71e0010ab3277b77cc0ae4d998c4b1d2b64/devtools/client/debugger/test/mochitest/browser_dbg_instruments-pane-collapse_keyboard.js#34

https://searchfox.org/mozilla-central/rev/7476b71e0010ab3277b77cc0ae4d998c4b1d2b64/devtools/client/shared/widgets/view-helpers.js#220

the test fails because the transition is cancelled in the following way:
  1. togglePane in test triggers togglePane in view-helpers.js, and transition starts (expanding)
  2. transition ends and transitionend event is dispatched
  3. transitionend event handler in the test is first called, and the promise gets resolved
  4. before executing the transitionend event handler in view-helpers.js, microtask check point happens and the remaining part of the test is executed
  5. the test triggers togglePane again, but the call aborts because animated attribute is still there

so, the test should wait for the next event tick to make sure the other event handlers get called, before continuing to the remaining part.
(Assignee)

Comment 1

4 days ago
Created attachment 8942446 [details] [diff] [review]
Part 1: Use Async Function in devtools/client/debugger/test/mochitest/browser_dbg_instruments-pane-collapse_keyboard.js

to debug the test, I converted the test to use async function,
I think landing the change as well won't harm.
Attachment #8942446 - Flags: review?(pbrosset)
(Assignee)

Comment 2

4 days ago
Created attachment 8942447 [details] [diff] [review]
Part 2: Wait for the next event tick after transitionend event to make sure the all event handlers finish in devtools/client/debugger/test/mochitest/browser_dbg_instruments-pane-collapse_keyboard.js

as mentioned in comment #0, after bug 1193394, the test needs to wait for the next event tick to avoid executing the remaining part of the test after receiving transitionend event, before the other transitionend event handler (that is, devtools's one).
Attachment #8942447 - Flags: review?(pbrosset)
Comment on attachment 8942446 [details] [diff] [review]
Part 1: Use Async Function in devtools/client/debugger/test/mochitest/browser_dbg_instruments-pane-collapse_keyboard.js

Review of attachment 8942446 [details] [diff] [review]:
-----------------------------------------------------------------

Much easier to read. Thank you.
Attachment #8942446 - Flags: review?(pbrosset) → review+
Attachment #8942447 - Flags: review?(pbrosset) → review+
You need to log in before you can comment on or make changes to this bug.