Commit f1fb6d61 authored by Nicolas Pena's avatar Nicolas Pena Committed by Commit Bot

[EventTiming] Move tests to WPT

This CL moves Event Timing tests to web-platform-tests. Relevant changes:
* Move to using test_driver.click.
* Replace setTimeout with step_timeout.
* Move to using a python-based slow image resource.

Bug: 841224
Change-Id: I21f322546815d7d6bcec4dd1703de50a9296d992
Reviewed-on: https://chromium-review.googlesource.com/c/1348855
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Reviewed-by: default avatarTimothy Dresser <tdresser@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610504}
parent a3da5edf
......@@ -115,7 +115,7 @@ crbug.com/813547 [ Linux ] webaudio/BiquadFilter/tail-time-lowpass.html [ Pass F
crbug.com/856601 [ Linux ] fast/css/visited-link-hang.html [ Pass Timeout ]
crbug.com/856601 [ Linux ] http/tests/devtools/elements/styles-4/styles-inline-element-style-changes-should-not-force-style-recalc.js [ Pass Timeout ]
crbug.com/856601 [ Linux ] http/tests/event-timing/event-timing-retrievability.html [ Pass Timeout ]
crbug.com/856601 [ Linux ] external/wpt/event-timing/event-timing-retrievability.html [ Pass Timeout ]
# Slow idlharness.js tests on MSAN
crbug.com/856601 [ Linux ] external/wpt/BackgroundSync/interfaces.https.any.html [ Timeout Pass ]
......
......@@ -901,13 +901,13 @@ crbug.com/874695 http/tests/devtools/sources/debugger/live-edit-no-reveal.js [ S
crbug.com/874695 http/tests/devtools/tracing/decode-resize.js [ Slow ]
crbug.com/874695 http/tests/devtools/tracing/timeline-paint/paint-profiler-update.js [ Slow ]
crbug.com/874695 http/tests/devtools/tracing/timeline-style/timeline-style-recalc-all-invalidator-types.js [ Slow ]
crbug.com/874695 http/tests/event-timing/event-timing-bufferbeforeonload.html [ Slow ]
crbug.com/874695 http/tests/event-timing/event-timing-crossiframe.html [ Slow ]
crbug.com/874695 http/tests/event-timing/event-timing-observethenonload.html [ Slow ]
crbug.com/874695 http/tests/event-timing/event-timing-onloadthenobserve-firstInput.html [ Slow ]
crbug.com/874695 http/tests/event-timing/event-timing-onloadthenobserve.html [ Slow ]
crbug.com/874695 http/tests/event-timing/event-timing-retrievability.html [ Slow ]
crbug.com/874695 http/tests/event-timing/event-timing-timingconditions.html [ Slow ]
crbug.com/874695 external/wpt/event-timing/event-timing-bufferbeforeonload.html [ Slow ]
crbug.com/874695 external/wpt/event-timing/event-timing-crossiframe.html [ Slow ]
crbug.com/874695 external/wpt/event-timing/event-timing-observethenonload.html [ Slow ]
crbug.com/874695 external/wpt/event-timing/event-timing-onloadthenobserve-firstInput.html [ Slow ]
crbug.com/874695 external/wpt/event-timing/event-timing-onloadthenobserve.html [ Slow ]
crbug.com/874695 external/wpt/event-timing/event-timing-retrievability.html [ Slow ]
crbug.com/874695 external/wpt/event-timing/event-timing-timingconditions.html [ Slow ]
crbug.com/874695 http/tests/fetch/serviceworker/body-mixin-base-https-other-https.html [ Slow ]
crbug.com/874695 http/tests/fetch/serviceworker-proxied/thorough/access-control-base-https-other-https.html [ Slow ]
crbug.com/874695 http/tests/fetch/serviceworker-proxied/thorough/auth-base-https-other-https.html [ Slow ]
......
......@@ -2792,8 +2792,8 @@ crbug.com/763830 http/tests/security/cors-rfc1918/ [ Skip ]
crbug.com/763830 virtual/outofblink-cors/http/tests/security/cors-rfc1918/ [ Skip ]
crbug.com/763830 virtual/outofblink-cors-ns/http/tests/security/cors-rfc1918/ [ Skip ]
crbug.com/831729 http/tests/event-timing/event-timing-crossiframe.html [ Timeout ]
crbug.com/831729 http/tests/event-timing/event-timing-observer-manual.html [ Skip ]
crbug.com/831729 external/wpt/event-timing/event-timing-crossiframe.html [ Timeout ]
crbug.com/831729 external/wpt/event-timing/event-timing-observer-manual.html [ Skip ]
# Working on getting the CSP tests going:
crbug.com/694525 external/wpt/content-security-policy/connect-src/worker-from-guid.sub.html [ Skip ]
......
......@@ -3,10 +3,12 @@
<meta charset=utf-8 />
<title>Event Timing: buffer long-latency events before onload</title>
<button id='button' onclick='clickDelay()'>Generate a 'click' event</button>
<script src=../../resources/testharness.js></script>
<script src=../../resources/testharnessreport.js></script>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/resources/testdriver.js></script>
<script src=/resources/testdriver-vendor.js></script>
<script src=./resources/event-timing-support.js></script>
<img src=./resources/slow-image.php>
<img src=./resources/slow-image.py>
<script>
let clickTimeMin;
......
......@@ -12,10 +12,12 @@
<div>
<iframe src=./resources/event-timing-crossiframe-childframe.html></iframe>
</div>
<script src=../../../resources/testharness.js></script>
<script src=../../../resources/testharnessreport.js></script>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/resources/testdriver.js></script>
<script src=/resources/testdriver-vendor.js></script>
<script src=./resources/event-timing-support.js></script>
<img src=./resources/slow-image.php>
<img src=./resources/slow-image.py>
<script>
let clickTimeMin;
let processingStartMin;
......
......@@ -4,10 +4,12 @@
<title>Event Timing: Performance observers can observe long-latency events
</title>
<button id='button' onclick='1'>Generate a 'click' event</button>
<script src=../../../resources/testharness.js></script>
<script src=../../../resources/testharnessreport.js></script>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/resources/testdriver.js></script>
<script src=/resources/testdriver-vendor.js></script>
<script src=./resources/event-timing-support.js></script>
<img src=./resources/slow-image.php>
<img src=./resources/slow-image.py>
<script>
let timeAfterFirstClick;
......
......@@ -3,8 +3,10 @@
<meta charset=utf-8 />
<title>Event Timing: buffer long-latency events before onload</title>
<button id='button' onclick='1'>Generate a 'click' event</button>
<script src=../../resources/testharness.js></script>
<script src=../../resources/testharnessreport.js></script>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/resources/testdriver.js></script>
<script src=/resources/testdriver-vendor.js></script>
<script src=./resources/event-timing-support.js></script>
<script>
......
......@@ -5,8 +5,10 @@
registration are lost
</title>
<button id='button' onclick='1'>Generate a 'click' event</button>
<script src=../../../resources/testharness.js></script>
<script src=../../../resources/testharnessreport.js></script>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/resources/testdriver.js></script>
<script src=/resources/testdriver-vendor.js></script>
<script src=./resources/event-timing-support.js></script>
<script>
let callbackTime;
......
......@@ -3,8 +3,10 @@
<meta charset=utf-8 />
<title>Event Timing: only observe the first input</title>
<button id='button' onclick='1'>Generate a 'click' event</button>
<script src=../../resources/testharness.js></script>
<script src=../../resources/testharnessreport.js></script>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/resources/testdriver.js></script>
<script src=/resources/testdriver-vendor.js></script>
<script src=./resources/event-timing-support.js></script>
<script>
......
......@@ -3,10 +3,12 @@
<meta charset=utf-8>
<title>Event Timing: make sure event-timing entries are retrievable by existing perf APIs.</title>
<button id='button' onclick='1'>Generate a 'click' event</button>
<script src=../../../resources/testharness.js></script>
<script src=../../../resources/testharnessreport.js></script>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/resources/testdriver.js></script>
<script src=/resources/testdriver-vendor.js></script>
<script src=./resources/event-timing-support.js></script>
<img src=./resources/slow-image.php>
<img src=./resources/slow-image.py>
<script>
function validateEntries() {
......
......@@ -5,8 +5,10 @@
</title>
<button id='button' onclick='mainThreadBusy(100)'
onfocus='mainThreadBusy(100)'>Generate a 'click' event</button>
<script src=../../../resources/testharness.js></script>
<script src=../../../resources/testharnessreport.js></script>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/resources/testdriver.js></script>
<script src=/resources/testdriver-vendor.js></script>
<script src=./resources/event-timing-support.js></script>
<script>
let trustedClickStart = 0;
......
<!DOCType html>
<html>
<script src=/resources/testdriver.js></script>
<script src=/resources/testdriver-vendor.js></script>
<script src=event-timing-support.js></script>
<button id='button_child_frame' onclick='2'>Generate a 'click' event</button>
<img src=slow-image.php>
<img src=slow-image.py>
<script>
const clickTimeMin = performance.now();
clickAndBlockMain('button_child_frame');
......
function clickOnElement(id, resolve) {
const element = document.getElementById(id);
const rect = element.getBoundingClientRect();
const xCenter = rect.x + rect.width / 2;
const yCenter = rect.y + rect.height / 2;
const leftButton = 0;
var pointerActions = [{
source: "mouse",
actions: [
{ name: "pointerDown", x: xCenter, y: yCenter, button: leftButton },
{ name: "pointerUp" },
]
}];
if (!chrome || !chrome.gpuBenchmarking) {
reject();
} else {
chrome.gpuBenchmarking.pointerActionSequence(pointerActions, resolve);
}
test_driver.click(element).then(resolve);
}
function mainThreadBusy(duration) {
......@@ -54,9 +39,7 @@ function verifyClickEvent(entry, is_first=false) {
function wait() {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve();
}, 0);
step_timeout(resolve, 0);
});
}
......
import time
def main(request, response):
# Sleep for 500ms to delay onload.
time.sleep(0.5)
response.headers.set("Cache-Control", "no-cache, must-revalidate");
response.headers.set("Location", "data:image/gif;base64,R0lGODlhAQABAJAAAMjIyAAAACwAAAAAAQABAAACAgQBADs%3D");
<?php
// Sleep for 500ms to delay onload.
usleep(500000);
header('Cache-Control: no-cache, must-revalidate');
header('Location: data:image/gif;base64,R0lGODlhAQABAJAAAMjIyAAAACwAAAAAAQABAAACAgQBADs%3D');
?>
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