pointerevent_common_input.js should not introduce its own async test |
||
Issue descriptionAt the moment pointerevent_common_input.js introduces an async test whole purpose is to ensure the test is not finished until input injection is complete. This hidden test is a subtle footgun where one uses testharness.js "Single Page Test" which is supposed to let the harness create the test automatically for simple async tests. See for example [1] testharness.js [2] has an explicit_done feature which seems to be designed for what the above fake test is trying to do. "This behaviour can be overridden by setting the explicit_done property to true in a call to setup(). If explicit_done is true, the test harness will not assume it is done until the global done() function is called. Once done() is called, the two conditions above apply like normal." [1] https://chromium-review.googlesource.com/c/chromium/src/+/1132386/5/third_party/WebKit/LayoutTests/external/wpt/css/css-scroll-snap/snap-at-user-scroll-end-manual.html [2] https://web-platform-tests.org/writing-tests/testharness-api.html
,
Jul 11
I understand you want to ensure testharness waits for input injection to be completed regardless of the tests.
At the moment, your solution is to create a fake test:
var pointerevent_automation = async_test("PointerEvent Automation");
// Defined in every test and should return a promise that gets resolved when input is finished.
inject_input().then(function() {
pointerevent_automation.done();
});
IMHO a better solution is to use explicit_done which causes the harness to wait for global done before considering test to be finished.
i.e.,
explicit_done = true;
inject_input().then(function() {
done();
});
This avoids the fake test that can cause problem and is more idiomatic.
I don't understand how this automation test wraps other tests can you elaborate and give and example.
,
Jul 11
nit: It should be setup({ "explicit_done": true });
,
Jul 11
The explicit_done doesn't resolve the issue. This is one example test: https://cs.chromium.org/chromium/src/third_party/WebKit/LayoutTests/external/wpt/pointerevents/pointerevent_change-touch-action-onpointerdown_touch-manual.html?q=explicit_done+file:%5Esrc/third_party/WebKit/LayoutTests/external/wpt/pointerevents/+package:%5Echromium$&dr=C&l=91 which also uses explicit_done and was causing the leak at the time before that change. The catch is that the test is calling done while GPU benchmarking was working.
,
Jul 11
|
||
►
Sign in to add a comment |
||
Comment 1 by nzolghadr@chromium.org
, Jul 11