Skip to content

Commit

Permalink
Add browser test to verify Cumulative Layout Shift hadRecentInput
Browse files Browse the repository at this point in the history
Add cumulative_layout_shift_browsertest to add coverage on CLS
hadRecentInput. In the simple-block-movement.html file, we perform the
first layout shift with 160px movement, and we pause the program for one
second, and we perform one click then perform another layout shift with
340px movement.

In CLS Normalization, we should only consider the first layout shift
since the second layout shift happened in 500ms after the click which
will reset the hadRecentInput timer.

Bug: 1370548
Change-Id: I7378acf445a133c12d21f4591dd83deba3f7e61a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4044285
Reviewed-by: Annie Sullivan <sullivan@chromium.org>
Commit-Queue: Han Gao <hangaoy@google.com>
Cr-Commit-Position: refs/heads/main@{#1075246}
  • Loading branch information
hangaoy authored and pull[bot] committed Dec 19, 2023
1 parent 5cad426 commit 1520938
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion layout-instability/resources/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ ScoreWatcher = function() {
list.getEntries().forEach(entry => {
this.lastEntry = entry;
this.score += entry.value;
watcher_entry_record.push({startTime: entry.startTime, score: entry.value});
watcher_entry_record.push({startTime: entry.startTime, score: entry.value, hadRecentInput : entry.hadRecentInput});
if (!entry.hadRecentInput)
this.scoreWithInputExclusion += entry.value;
this.resolve();
Expand Down

0 comments on commit 1520938

Please sign in to comment.