New issue
Advanced search Search tips

Issue 862616 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Jul 11
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

pointerevent_common_input.js should not introduce its own async test

Project Member Reported by majidvp@chromium.org, Jul 11

Issue description

At 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
 
Status: Assigned (was: Untriaged)
Can you elaborate a little more on the issue?

The original issue was that GPU benchmarking was queueing some tasks and then test would say done and then GPU benchmarking tasks were causing leaks. So we had to wait until GPU benchmarking instructions are done as well. Also some of pointerevent tests have a notion of running the same test multiple times. So we have a series of async tests but this automation test wraps them all.
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.

nit: It should be setup({ "explicit_done": true });

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.
Status: WontFix (was: Assigned)

Sign in to add a comment