Commit a97f76cd authored by Nicolás Peña's avatar Nicolás Peña Committed by Commit Bot

Move EventTiming tests to WPT

This CL moves the tests in http/tests/event-timing to external/wpt/event-timing.
The slow image is change from php based to python based. The click is now
handled by test driver. and setTimeout is replaced with step_timeout.

Bug: 841224
Change-Id: I035c087550a2d9a67cda1aed88553c16967d04b6
Reviewed-on: https://chromium-review.googlesource.com/c/1349451
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Reviewed-by: default avatarTimothy Dresser <tdresser@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610669}
parent 5f5daa12
...@@ -115,7 +115,7 @@ crbug.com/813547 [ Linux ] webaudio/BiquadFilter/tail-time-lowpass.html [ Pass F ...@@ -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 ] 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/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 # Slow idlharness.js tests on MSAN
crbug.com/856601 [ Linux ] external/wpt/BackgroundSync/interfaces.https.any.html [ Timeout Pass ] crbug.com/856601 [ Linux ] external/wpt/BackgroundSync/interfaces.https.any.html [ Timeout Pass ]
......
...@@ -904,13 +904,13 @@ crbug.com/874695 http/tests/devtools/sources/debugger/live-edit-no-reveal.js [ S ...@@ -904,13 +904,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/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-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/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 external/wpt/event-timing/event-timing-bufferbeforeonload.html [ Slow ]
crbug.com/874695 http/tests/event-timing/event-timing-crossiframe.html [ Slow ] crbug.com/874695 external/wpt/event-timing/event-timing-crossiframe.html [ Slow ]
crbug.com/874695 http/tests/event-timing/event-timing-observethenonload.html [ Slow ] crbug.com/874695 external/wpt/event-timing/event-timing-observethenonload.html [ Slow ]
crbug.com/874695 http/tests/event-timing/event-timing-onloadthenobserve-firstInput.html [ Slow ] crbug.com/874695 external/wpt/event-timing/event-timing-onloadthenobserve-firstInput.html [ Slow ]
crbug.com/874695 http/tests/event-timing/event-timing-onloadthenobserve.html [ Slow ] crbug.com/874695 external/wpt/event-timing/event-timing-onloadthenobserve.html [ Slow ]
crbug.com/874695 http/tests/event-timing/event-timing-retrievability.html [ Slow ] crbug.com/874695 external/wpt/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-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/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/access-control-base-https-other-https.html [ Slow ]
crbug.com/874695 http/tests/fetch/serviceworker-proxied/thorough/auth-base-https-other-https.html [ Slow ] crbug.com/874695 http/tests/fetch/serviceworker-proxied/thorough/auth-base-https-other-https.html [ Slow ]
......
...@@ -2795,8 +2795,8 @@ crbug.com/763830 http/tests/security/cors-rfc1918/ [ Skip ] ...@@ -2795,8 +2795,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/http/tests/security/cors-rfc1918/ [ Skip ]
crbug.com/763830 virtual/outofblink-cors-ns/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 external/wpt/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-observer-manual.html [ Skip ]
# Working on getting the CSP tests going: # Working on getting the CSP tests going:
crbug.com/694525 external/wpt/content-security-policy/connect-src/worker-from-guid.sub.html [ Skip ] crbug.com/694525 external/wpt/content-security-policy/connect-src/worker-from-guid.sub.html [ Skip ]
......
...@@ -3,10 +3,12 @@ ...@@ -3,10 +3,12 @@
<meta charset=utf-8 /> <meta charset=utf-8 />
<title>Event Timing: buffer long-latency events before onload</title> <title>Event Timing: buffer long-latency events before onload</title>
<button id='button' onclick='clickDelay()'>Generate a 'click' event</button> <button id='button' onclick='clickDelay()'>Generate a 'click' event</button>
<script src=../../resources/testharness.js></script> <script src=/resources/testharness.js></script>
<script src=../../resources/testharnessreport.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 src=./resources/event-timing-support.js></script>
<img src=./resources/slow-image.php> <img src=./resources/slow-image.py>
<script> <script>
let clickTimeMin; let clickTimeMin;
......
...@@ -12,10 +12,12 @@ ...@@ -12,10 +12,12 @@
<div> <div>
<iframe src=./resources/event-timing-crossiframe-childframe.html></iframe> <iframe src=./resources/event-timing-crossiframe-childframe.html></iframe>
</div> </div>
<script src=../../../resources/testharness.js></script> <script src=/resources/testharness.js></script>
<script src=../../../resources/testharnessreport.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 src=./resources/event-timing-support.js></script>
<img src=./resources/slow-image.php> <img src=./resources/slow-image.py>
<script> <script>
let clickTimeMin; let clickTimeMin;
let processingStartMin; let processingStartMin;
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
function onMakeBusy() { function onMakeBusy() {
log("busy start"); log("busy start");
setTimeout(()=>{ step_timeout(()=>{
mainThreadBusy(2000); mainThreadBusy(2000);
log("busy end"); log("busy end");
}, 0); }, 0);
......
...@@ -4,10 +4,12 @@ ...@@ -4,10 +4,12 @@
<title>Event Timing: Performance observers can observe long-latency events <title>Event Timing: Performance observers can observe long-latency events
</title> </title>
<button id='button' onclick='1'>Generate a 'click' event</button> <button id='button' onclick='1'>Generate a 'click' event</button>
<script src=../../../resources/testharness.js></script> <script src=/resources/testharness.js></script>
<script src=../../../resources/testharnessreport.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 src=./resources/event-timing-support.js></script>
<img src=./resources/slow-image.php> <img src=./resources/slow-image.py>
<script> <script>
let timeAfterFirstClick; let timeAfterFirstClick;
......
...@@ -3,8 +3,10 @@ ...@@ -3,8 +3,10 @@
<meta charset=utf-8 /> <meta charset=utf-8 />
<title>Event Timing: buffer long-latency events before onload</title> <title>Event Timing: buffer long-latency events before onload</title>
<button id='button' onclick='1'>Generate a 'click' event</button> <button id='button' onclick='1'>Generate a 'click' event</button>
<script src=../../resources/testharness.js></script> <script src=/resources/testharness.js></script>
<script src=../../resources/testharnessreport.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 src=./resources/event-timing-support.js></script>
<script> <script>
......
...@@ -5,8 +5,10 @@ ...@@ -5,8 +5,10 @@
registration are lost registration are lost
</title> </title>
<button id='button' onclick='1'>Generate a 'click' event</button> <button id='button' onclick='1'>Generate a 'click' event</button>
<script src=../../../resources/testharness.js></script> <script src=/resources/testharness.js></script>
<script src=../../../resources/testharnessreport.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 src=./resources/event-timing-support.js></script>
<script> <script>
let callbackTime; let callbackTime;
......
...@@ -3,8 +3,10 @@ ...@@ -3,8 +3,10 @@
<meta charset=utf-8 /> <meta charset=utf-8 />
<title>Event Timing: only observe the first input</title> <title>Event Timing: only observe the first input</title>
<button id='button' onclick='1'>Generate a 'click' event</button> <button id='button' onclick='1'>Generate a 'click' event</button>
<script src=../../resources/testharness.js></script> <script src=/resources/testharness.js></script>
<script src=../../resources/testharnessreport.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 src=./resources/event-timing-support.js></script>
<script> <script>
...@@ -42,4 +44,4 @@ ...@@ -42,4 +44,4 @@
"Event Timing: check firstInput for a PerformanceObserver observing only firstInput." "Event Timing: check firstInput for a PerformanceObserver observing only firstInput."
); );
</script> </script>
</html> </html>
\ No newline at end of file
...@@ -3,10 +3,12 @@ ...@@ -3,10 +3,12 @@
<meta charset=utf-8> <meta charset=utf-8>
<title>Event Timing: make sure event-timing entries are retrievable by existing perf APIs.</title> <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> <button id='button' onclick='1'>Generate a 'click' event</button>
<script src=../../../resources/testharness.js></script> <script src=/resources/testharness.js></script>
<script src=../../../resources/testharnessreport.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 src=./resources/event-timing-support.js></script>
<img src=./resources/slow-image.php> <img src=./resources/slow-image.py>
<script> <script>
function validateEntries() { function validateEntries() {
...@@ -28,11 +30,7 @@ ...@@ -28,11 +30,7 @@
Validate entries Validate entries
*/ */
async_test(function(t) { async_test(function(t) {
clickAndBlockMain('button'); clickAndBlockMain('button').then(wait).then(t.step_func_done(validateEntries));
on_event(window, 'load', e => {
validateEntries();
t.done();
});
}, "Event Timing: make sure event-timing entries are retrievable by existing perf APIs."); }, "Event Timing: make sure event-timing entries are retrievable by existing perf APIs.");
</script> </script>
......
...@@ -3,21 +3,14 @@ ...@@ -3,21 +3,14 @@
<meta charset=utf-8 /> <meta charset=utf-8 />
<title>Event Timing only times certain types of trusted event. <title>Event Timing only times certain types of trusted event.
</title> </title>
<button id='button' onclick='mainThreadBusy(100)' <button id='button' onfocus='mainThreadBusy(100)'>Generate a 'click' event</button>
onfocus='mainThreadBusy(100)'>Generate a 'click' event</button> <script src=/resources/testharness.js></script>
<script src=../../../resources/testharness.js></script> <script src=/resources/testharnessreport.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 src=./resources/event-timing-support.js></script>
<script> <script>
let trustedClickStart = 0; let trustedClickStart = 0;
function trustedClickAndBlockMain(id) {
return new Promise((resolve, reject) => {
trustedClickStart = performance.now();
clickOnElement(id);
mainThreadBusy(100);
resolve();
});
}
function untrustedClickAndBlockMain(id) { function untrustedClickAndBlockMain(id) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
...@@ -60,7 +53,8 @@ ...@@ -60,7 +53,8 @@
// trusted event of a type event timing doesn't cares about // trusted event of a type event timing doesn't cares about
trustedFocusAndBlockMain('button').then(wait); trustedFocusAndBlockMain('button').then(wait);
// trusted event of a type event timing cares about // trusted event of a type event timing cares about
trustedClickAndBlockMain('button').then(wait); trustedClickStart = performance.now();
clickAndBlockMain('button').then(wait);
}, "Event Timing only times certain types of trusted event."); }, "Event Timing only times certain types of trusted event.");
</script> </script>
</html> </html>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<html> <html>
<script src=event-timing-support.js></script> <script src=event-timing-support.js></script>
<button id='button_child_frame' onclick='2'>Generate a 'click' event</button> <button id='button_child_frame' onclick='2'>Generate a 'click' event</button>
<img src=slow-image.php> <img src=slow-image.py>
<script> <script>
const clickTimeMin = performance.now(); const clickTimeMin = performance.now();
clickAndBlockMain('button_child_frame'); clickAndBlockMain('button_child_frame');
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
function onMakeBusy() { function onMakeBusy() {
log("busy start"); log("busy start");
setTimeout(()=>{ step_timeout(()=>{
mainThreadBusy(2000); mainThreadBusy(2000);
log("busy end"); log("busy end");
}, 0); }, 0);
......
function clickOnElement(id, callback) { function clickOnElement(id, resolve) {
const element = document.getElementById(id); const element = document.getElementById(id);
const rect = element.getBoundingClientRect(); const clickHandler = () => {
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" },
]
}];
var clickHandler = () => {
if (callback)
callback();
element.removeEventListener("click", clickHandler); element.removeEventListener("click", clickHandler);
resolve();
}; };
element.addEventListener("click", clickHandler); element.addEventListener("click", clickHandler);
if (!chrome || !chrome.gpuBenchmarking) { test_driver.click(element);
reject();
} else {
chrome.gpuBenchmarking.pointerActionSequence(pointerActions);
}
} }
function mainThreadBusy(duration) { function mainThreadBusy(duration) {
...@@ -29,7 +13,7 @@ function mainThreadBusy(duration) { ...@@ -29,7 +13,7 @@ function mainThreadBusy(duration) {
while (performance.now() < now + duration); while (performance.now() < now + duration);
} }
// This method should receive an entry of type 'event'. |is_false| is true only // This method should receive an entry of type 'event'. |is_first| is true only
// when the event also happens to correspond to the first event. In this case, // when the event also happens to correspond to the first event. In this case,
// the timings of the 'firstInput' entry should be equal to those of this entry. // the timings of the 'firstInput' entry should be equal to those of this entry.
function verifyClickEvent(entry, is_first=false) { function verifyClickEvent(entry, is_first=false) {
...@@ -60,7 +44,7 @@ function verifyClickEvent(entry, is_first=false) { ...@@ -60,7 +44,7 @@ function verifyClickEvent(entry, is_first=false) {
function wait() { function wait() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
setTimeout(() => { step_timeout(() => {
resolve(); resolve();
}, 0); }, 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