Bug 203063 - Cannot run some WPT cases manually
Summary: Cannot run some WPT cases manually
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Peng Liu
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-10-16 17:22 PDT by Peng Liu
Modified: 2019-10-22 10:44 PDT (History)
6 users (show)

See Also:


Attachments
Patch (1.31 KB, patch)
2019-10-16 17:32 PDT, Peng Liu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peng Liu 2019-10-16 17:22:38 PDT
Due to the updates about LayoutTests/imported/w3c/web-platform-tests/resources/testdriver-vendor.js in https://trac.webkit.org/changeset/251043, we are not able to run some WPT cases manually.
Comment 1 Peng Liu 2019-10-16 17:32:24 PDT
Created attachment 381137 [details]
Patch
Comment 2 Peng Liu 2019-10-16 20:16:25 PDT
One affected WPT case: LayoutTests/imported/w3c/web-platform-tests/picture-in-picture/exit-picture-in-picture.html.

We need to make sure the test case can run in the browser.
Comment 3 youenn fablet 2019-10-17 06:42:06 PDT
I guess the affected test expects user to click somewhere.
There might be a race in the sense the promise will get resolved while the user might not have clicked already.
This seems better than throwing though.
What would be the result of rejecting the promise?
Comment 4 Peng Liu 2019-10-17 08:53:57 PDT
With this patch, when we run the case manually in a browser tab, the promise in window.test_driver_internal.click will be resolved directly. However, that will be OK because the promise of the bless function will not be resolved and the page will wait for a user to click the button to execute the test.

Without this patch, the case will fail with "promise_test: Unhandled rejection with value: object "Error: window.eventSender is undefined."". The test case will not have a chance to execute.
Comment 5 Ryosuke Niwa 2019-10-17 14:00:40 PDT
Comment on attachment 381137 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=381137&action=review

> LayoutTests/imported/w3c/web-platform-tests/resources/testdriver-vendor.js:184
> +    if (!window.testRunner)
> +        return Promise.resolve();

Hm... I'm not sure if this is right thing to do here.
Some tests would expect that the click had already happened after this.
We probably want to wait for click event to get dispatched on element.
Comment 6 Peng Liu 2019-10-17 14:11:37 PDT
Comment on attachment 381137 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=381137&action=review

>> LayoutTests/imported/w3c/web-platform-tests/resources/testdriver-vendor.js:184
>> +        return Promise.resolve();
> 
> Hm... I'm not sure if this is right thing to do here.
> Some tests would expect that the click had already happened after this.
> We probably want to wait for click event to get dispatched on element.

In a manual test (open the test page in a browser tab), user can click the button to execute the test case. Could you give an example test case that needs the click to be done automatically?
Comment 7 WebKit Commit Bot 2019-10-22 10:43:08 PDT
Comment on attachment 381137 [details]
Patch

Clearing flags on attachment: 381137

Committed r251440: <https://trac.webkit.org/changeset/251440>
Comment 8 WebKit Commit Bot 2019-10-22 10:43:09 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Radar WebKit Bug Importer 2019-10-22 10:44:24 PDT
<rdar://problem/56505834>