Commit 5e2d9bc8 authored by Nicolas Pena's avatar Nicolas Pena Committed by Commit Bot

Move webtiming-resolution, webtiming-ssl to wpt

This CL changes the webtiming-resolution to test that resolution is
larger than 10 microseconds, instead of testing for a specific value.
This allows the test to no longer be flaky and to be moved to wpt.

The webtiming-ssl test is moved to WPT, using an https connection to
ensure that secureConnectionStart is correctly defined.

Bug: chromium:801341
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I4d31faa08d00251098f3dc648c794d80bbcc2f22
Reviewed-on: https://chromium-review.googlesource.com/867310
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Reviewed-by: default avatarRobert Ma <robertma@chromium.org>
Reviewed-by: default avatarTimothy Dresser <tdresser@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553666}
parent 62e590c5
......@@ -3132,9 +3132,6 @@ crbug.com/798572 virtual/enable_wasm/external/wpt/wasm/wasm_service_worker_test.
# Does not work on Mac
crbug.com/793771 [ Mac ] virtual/modern-media-controls/media/controls/modern/scrubbing.html [ Skip ]
# Flaky on Windows
crbug.com/801341 [ Win ] http/tests/misc/webtiming-resolution.html [ Failure Pass ]
crbug.com/797138 external/wpt/credential-management/federatedcredential-framed-get.sub.https.html [ Crash ]
crbug.com/797138 external/wpt/credential-management/passwordcredential-framed-get.sub.https.html [ Crash ]
......
......@@ -3888,9 +3888,6 @@ crbug.com/798572 virtual/enable_wasm/external/wpt/wasm/wasm_service_worker_test.
# Does not work on Mac
crbug.com/793771 [ Mac ] virtual/modern-media-controls/media/controls/modern/scrubbing.html [ Skip ]
# Flaky on Windows
crbug.com/801341 [ Win ] http/tests/misc/webtiming-resolution.html [ Failure Pass ]
crbug.com/797138 external/wpt/credential-management/federatedcredential-framed-get.sub.https.html [ Crash ]
crbug.com/797138 external/wpt/credential-management/passwordcredential-framed-get.sub.https.html [ Crash ]
......
<!DOCTYPE HTML>
<html>
<body>
<script>
parent.postMessage([
performance.timing.connectStart,
performance.timing.navigationStart,
performance.timing.secureConnectionStart,
performance.timing.connectEnd
], '*');
</script>
</body>
</html>
<!DOCTYPE HTML>
<html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<!-- Use https to ensure secureConnectionStart is nontrivial, if it is supported. -->
<iframe src="https://{{host}}:{{ports[https][0]}}/navigation-timing/resources/performance_attribute_sender.html"></iframe>
<body>
<script>
async_test(function(t) {
window.addEventListener('message', t.step_func_done(function(event) {
const connectStart = event.data[0];
const navigationStart = event.data[1];
const secureConnectionStart = event.data[2];
const connectEnd = event.data[3];
assert_greater_than_equal(connectStart, navigationStart,
'performance.timing.connectStart >= performance.timing.navigationStart');
// secureConnectionStart is an optional attribute.
if (secureConnectionStart == undefined) {
return;
}
assert_greater_than_equal(secureConnectionStart, connectStart,
'performance.timing.secureConnectionStart >= performance.timing.connectStart');
assert_greater_than_equal(connectEnd, secureConnectionStart,
'performance.timing.connectEnd >= performance.timing.secureConnectionStart');
}));
}, 'Check that performance.timing has reasonable values for secureConnectionStart and other attributes');
</script>
</body>
</html>
<!DOCTYPE HTML>
<html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
function testTimeResolution(highResTimeFunc, funcString) {
test(() => {
const t0 = highResTimeFunc();
let t1 = highResTimeFunc();
while (t0 == t1) {
t1 = highResTimeFunc();
}
assert_greater_than_equal(t1 - t0, 0.02, 'The second ' + funcString + ' should be much greater than the first');
}, 'Verifies the resolution of ' + funcString + ' is at least 20 microseconds.');
}
function timeByPerformanceNow() {
return performance.now();
}
function timeByUserTiming() {
performance.mark('timer');
const time = performance.getEntriesByName('timer')[0].startTime;
performance.clearMarks('timer');
return time;
}
testTimeResolution(timeByPerformanceNow, 'performance.now()');
testTimeResolution(timeByUserTiming, 'entry.startTime');
</script>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script>
</script>
<script src="../../js-test-resources/js-test.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description("This test checks that Web Timing reports secureConnectionStart correctly and has reasonable values for connectStart and connectEnd. Note that DumpRenderTree doesn't set secureConnectionStart.");
window.performance = window.performance || {};
var navigation = performance.navigation || {};
var timing = performance.timing || {};
shouldBeGreaterThanOrEqual("timing.connectStart", "timing.navigationStart");
shouldBeGreaterThanOrEqual("timing.secureConnectionStart", "timing.connectStart");
shouldBeGreaterThanOrEqual("timing.connectEnd", "timing.secureConnectionStart");
</script>
</body>
</html>
Verifies the minimum resolution is 100 microseconds.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS shouldBeNearZeroOrOne < 1e-5 || Math.abs(shouldBeNearZeroOrOne - 1) < 1e-5 is true
PASS shouldBeNearZeroOrOne < 1e-5 || Math.abs(shouldBeNearZeroOrOne - 1) < 1e-5 is true
PASS successfullyParsed is true
TEST COMPLETE
<html>
<head>
<script src="/js-test-resources/js-test.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description("Verifies the minimum resolution is 100 microseconds.");
function testTimeResolution(highResTimeFunc) {
var t0 = highResTimeFunc();
var t1 = highResTimeFunc();
while (t0 == t1) {
t1 = highResTimeFunc();
}
var expectedResolutionMilliseconds = 0.100;
var integerMultipleOfResolution = (t1 - t0) / expectedResolutionMilliseconds;
shouldBeNearZeroOrOne = integerMultipleOfResolution % 1;
shouldBe("shouldBeNearZeroOrOne < 1e-5 || Math.abs(shouldBeNearZeroOrOne - 1) < 1e-5", "true");
}
function timeByPerformanceNow() {
return performance.now();
}
function timeByUserTiming() {
performance.mark('timer');
var t = performance.getEntriesByName('timer')[0].startTime;
performance.clearMarks('timer');
return t;
}
testTimeResolution(timeByPerformanceNow);
testTimeResolution(timeByUserTiming);
</script>
</body>
</html>
This test checks that Web Timing reports secureConnectionStart correctly and has reasonable values for connectStart and connectEnd. Note that DumpRenderTree doesn't set secureConnectionStart.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS timing.connectStart is >= timing.navigationStart
PASS timing.secureConnectionStart is >= timing.connectStart
PASS timing.connectEnd is >= timing.secureConnectionStart
PASS successfullyParsed is true
TEST COMPLETE
<?php
header('Location: https://127.0.0.1:8443/misc/resources/webtiming-ssl.html');
header('HTTP/1.0 302 Found');
?>
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