Commit 7e454669 authored by Nicolás Peña Moreno's avatar Nicolás Peña Moreno Committed by Commit Bot

[EventTiming] Increase threshold to dispatch entries

Per the spec change, the entry should be dispatched when |duration| is
at least 104. This aligns better with the RAIL guideline of responding
to user input within 100 ms.

Bug: 823744
Change-Id: I7230c04bb7962b5e6403a56cd2b53a56b7a27bcb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1592705Reviewed-by: default avatarTimothy Dresser <tdresser@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#656368}
parent 5ed37e34
......@@ -62,7 +62,7 @@ namespace {
// Events taking longer than this threshold to finish being processed are
// regarded as long-latency events by event-timing. Shorter-latency events are
// ignored to reduce performance impact.
constexpr int kEventTimingDurationThresholdInMs = 50;
constexpr int kEventTimingDurationThresholdInMs = 104;
String GetFrameAttribute(HTMLFrameOwnerElement* frame_owner,
const QualifiedName& attr_name,
......@@ -379,7 +379,7 @@ void WindowPerformance::ReportEventTimings(WebWidgetClient::SwapResult result,
PerformanceEventTiming::CreateFirstInputTiming(entry));
}
}
if (duration_in_ms <= kEventTimingDurationThresholdInMs)
if (duration_in_ms < kEventTimingDurationThresholdInMs)
continue;
if (HasObserverFor(PerformanceEntry::kEvent)) {
......
......@@ -8,7 +8,7 @@ function clickOnElement(id, callback) {
const yCenter = rect.y + rect.height / 2;
const leftButton = 0;
const clickHandler = () => {
mainThreadBusy(60);
mainThreadBusy(120);
if (callback)
callback();
element.removeEventListener("mousedown", clickHandler);
......@@ -29,8 +29,8 @@ function verifyClickEvent(entry, is_first=false) {
assert_true(entry.cancelable);
assert_equals(entry.name, 'mousedown');
assert_equals(entry.entryType, 'event');
assert_greater_than(entry.duration, 50,
"The entry's duration should be greater than 50ms.");
assert_greater_than_equal(entry.duration, 104,
"The entry's duration should be greater than or equal to 104 ms.");
assert_greater_than(entry.processingStart, entry.startTime,
"The entry's processingStart should be greater than startTime.");
assert_greater_than_equal(entry.processingEnd, entry.processingStart,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment