1. Do the API record the entry to the buffer only after PO starts to observe the ‘event’ entry type?
2. If the event timing buffer is full, it doesn’t add entries to the buffer anymore, but generate a eventtimingbufferfull event, which is handled by oneventtimingbufferfull handler.
3. To clear the event timing buffer, we need to call performance.clearEventTimings().
We are moving towards a better cross browser web driver-y approach. But so far we only have the click API landed.
https://cs.chromium.org/chromium/src/third_party/WebKit/LayoutTests/resources/testdriver.js?l=60
The work is being done for the rest of the pointer action APIs. It should land sometime in Q2. But for now feel free to use the same approach as we are using which is what Tim pointed out.
Tim. One tricky question, is buffering before onload defines 'before' as the event's start-time or processing-time before onload-start. Intuitively it should use the start-time, but I found observer is using processing time (in other words, an observer can observe something happening before the observer is registered).
Oh, interesting. Intuitively, it feels like start time makes more sense, but this might fall apart with custom user timing entries, where the start time can be set to anything.
We should be consistent here - maybe the only reasonable thing is to use when the entry is created?
As it happens only when the mainthread is so busy that a input happening before observer start is delayed until after the observer start to be dispatched & processed. We probably don't want to sacrifice performance on each event for the sake of this rare situation.
For testing purpose, I am trying to simulate dispatching an event that can cause default actions or being handled before onload.
I've tried right clicks. But as right clicks will open a context menu, when there are multiple clicks, the second click may fall into the context menu created by the first click, unless the second click is fast enough that it can fall into the window before the context menu is created.
Left clicks seem not working, because there is no handler or default actions that can be triggered before onload.
Do you know of any other way to do that?
performance/event-timing/event-timing-bufferbeforeonload.html is found to be flaky on Linux site_per_process_webkit_layout_tests
https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Linux%20Tests/70097
FAIL Event Timing: click, onload. assert_greater_than: expected a number greater than 544.2 but got 544.0859375
Could you please take a look?
Thanks
Thanks for reporting it. Unfortunately there is not enough error information to tell the line of failure. I will mark it as flaky and add more error information for observation before fixing it. Does it sound good to you?
Comment 1 by maxlg@google.com
, Mar 20 2018