Skip to content

Commit

Permalink
Reland "[EventTiming] Fix programmatic click test"
Browse files Browse the repository at this point in the history
This is a reland of 3bd9684

The failure was not getting an entry for click:
https://ci.chromium.org/p/chromium/builders/ci/Mac10.13%20Tests/13241

Thus, we instead look at the mousedown. Since mousedown can be the first
input, we stop observing for firstInput but check that entry separately
as well.

Original change's description:
> [EventTiming] Fix programmatic click test
>
> Commits aee8357 and
> faed29a landed almost at the same time,
> so we accidentally landed a test with the wrong script src for the
> helper functions.
>
> Bug: 961547
> Change-Id: Id8a615477a54e56139d9d90fc4feb5f780b729a2
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1606225
> Reviewed-by: Liquan (Max) Gu <maxlg@chromium.org>
> Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#658761}

Bug: 961547
Change-Id: I11f1a5f28e7e4e5ebda28c90555d89669142cc09
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1610022
Reviewed-by: Liquan (Max) Gu <maxlg@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659680}
  • Loading branch information
npm1 authored and Commit Bot committed May 14, 2019
1 parent 066e9b8 commit 223d6ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 0 additions & 3 deletions third_party/blink/web_tests/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -5562,9 +5562,6 @@ crbug.com/959129 [ Win Linux ] http/tests/devtools/tracing/timeline-script-parse
# Sheriff 2019-05-07
crbug.com/960443 [ Mac10.10 Mac10.11 ] external/wpt/animation-worklet/worklet-animation-with-scroll-timeline.https.html [ Failure Pass ]

# Sheriff 2019-05-07
crbug.com/961547 external/wpt/event-timing/programmatic-click-not-observed.html [ Pass Failure ]

# Sheriff 2019-05-10
crbug.com/960623 [ Win ] http/tests/misc/resource-timing-sizes-multipart.html [ Pass Failure ]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<script src=/resources/testdriver.js></script>
<script src=/resources/testdriver-vendor.js></script>

<script src=resources/event-timing-support.js></script>
<script src=resources/event-timing-test-utils.js></script>
<script>
let delayCalled = false;
let beforeClick;
Expand All @@ -19,15 +19,19 @@
}
async_test(function(t) {
const observer = new PerformanceObserver(t.step_func_done((entryList) => {
const entries = entryList.getEntries().filter(e => e.name === 'click');
const entries = entryList.getEntries().filter(e => e.name === 'mousedown');
// There must only be one click entry: from the clickAndBlockMain() call.
assert_equals(entries.length, 1);
const entry = entries[0];
// This ensures that the entry is exposing timing from the second click, i.e.
// the one from the clickAndBlockMain() call.
assert_greater_than_equal(entry.processingStart, beforeClick);
// Check that the first input entry was also from the second click.
const firstInput = performance.getEntriesByType('firstInput');
assert_equals(firstInput.length, 1);
assert_greater_than_equal(firstInput[0].processingStart, beforeClick);
}));
observer.observe({entryTypes: ['firstInput', 'event']});
observer.observe({entryTypes: ['event']});
document.getElementById('div').click();
// Take the timestamp after the programmatic click but before the next click.
beforeClick = performance.now();
Expand Down

0 comments on commit 223d6ec

Please sign in to comment.