RESOLVED FIXED Bug 225202
REGRESSION: [iOS] 6 media/modern-media-controls/tracks-support/ tests timing out
https://bugs.webkit.org/show_bug.cgi?id=225202
Summary REGRESSION: [iOS] 6 media/modern-media-controls/tracks-support/ tests timing out
Aditya Keerthi
Reported 2021-04-29 12:12:17 PDT
...
Attachments
Patch (14.83 KB, patch)
2021-04-29 12:14 PDT, Aditya Keerthi
no flags
Patch for landing (14.87 KB, patch)
2021-04-29 12:53 PDT, Aditya Keerthi
no flags
Aditya Keerthi
Comment 1 2021-04-29 12:12:30 PDT
Aditya Keerthi
Comment 2 2021-04-29 12:14:05 PDT
Devin Rousso
Comment 3 2021-04-29 12:24:18 PDT
Comment on attachment 427367 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=427367&action=review r=me > LayoutTests/ChangeLog:14 > + of the <video> element was increased. However, on iOS, this led to the > + tracks button being positioned outside the viewport. Consequently, any LOL!!! I did not think of this at all! Great catch! > LayoutTests/ChangeLog:30 > + which lead to getTracksContextMenu() getting called before the tap > + actually completed. UIScriptController clears all callbacks after one Oh wow that is a *subtle* detail of UIScriptController :( Why was it made like this? I would think that one kind of callback wouldn't affect any other kind of callback? Personally I prefer the approach of establishing listeners/callbacks for actions before the action occurs so that there's no chance of it being missed (I also think it reads nicer). > LayoutTests/media/modern-media-controls/resources/media-controls-utils.js:49 > +function pressOnElementAsync(element) NIT: I feel like "Async" isn't the right name for this since `pressOnElement` also takes a `continuation` callback. Maybe `promisifiedPressOnElement`, or even just having `pressOnElement` return a `Promise` if it's not provided a `continuation`? ``` let promise = null; if (typeof continuation !== "function") { promise = new Promise((resolve, reject) => { continuation = resolve; }); } ... return promise || true; ```
Aditya Keerthi
Comment 4 2021-04-29 12:53:47 PDT
Created attachment 427370 [details] Patch for landing
Aditya Keerthi
Comment 5 2021-04-29 12:56:14 PDT
(In reply to Devin Rousso from comment #3) > Comment on attachment 427367 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=427367&action=review > > r=me > > > LayoutTests/ChangeLog:14 > > + of the <video> element was increased. However, on iOS, this led to the > > + tracks button being positioned outside the viewport. Consequently, any > > LOL!!! I did not think of this at all! Great catch! > > > LayoutTests/ChangeLog:30 > > + which lead to getTracksContextMenu() getting called before the tap > > + actually completed. UIScriptController clears all callbacks after one > > Oh wow that is a *subtle* detail of UIScriptController :( > > Why was it made like this? I would think that one kind of callback wouldn't > affect any other kind of callback? Personally I prefer the approach of > establishing listeners/callbacks for actions before the action occurs so > that there's no chance of it being missed (I also think it reads nicer). The logic to clear callbacks on `uiScriptComplete` was added in https://trac.webkit.org/changeset/192039/webkit, to prevent callbacks from sticking around in later tests. > > LayoutTests/media/modern-media-controls/resources/media-controls-utils.js:49 > > +function pressOnElementAsync(element) > > NIT: I feel like "Async" isn't the right name for this since > `pressOnElement` also takes a `continuation` callback. Maybe > `promisifiedPressOnElement`, or even just having `pressOnElement` return a > `Promise` if it's not provided a `continuation`? > ``` > let promise = null; > if (typeof continuation !== "function") { > promise = new Promise((resolve, reject) => { > continuation = resolve; > }); > } > ... > return promise || true; > ``` Thanks for code snippet! I've made `pressOnElement` return a `Promise` if it's not provided a `continuation`.
EWS
Comment 6 2021-04-29 16:44:37 PDT
Committed r276822 (237177@main): <https://commits.webkit.org/237177@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 427370 [details].
Note You need to log in before you can comment on or make changes to this bug.