Bug 1566056 [wpt PR 17832] - [Navigation timing] Add secure connection start reuse test, a=testonly

Automatic update from web-platform-tests
[Navigation timing] Add secure connection start reuse test

During the review of https://github.com/w3c/navigation-timing/pull/106
it was noted that secureConnectionStart's behavior with regards to
connection reuse and navigation timing is not well-tested.
This CL adds such a test.

Change-Id: I91d7cbfe4f1ee58a72b4a647a38bd58d4ffca693
Bug: 977519
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1702022
Commit-Queue: Yoav Weiss <yoavweiss@chromium.org>
Reviewed-by: Nicolás Peña Moreno <npm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#677521}

--

wpt-commits: 391c8f12e270cf0cadb26dc06b5d9984afe34a4c
wpt-pr: 17832
This commit is contained in:
Yoav Weiss 2019-07-22 11:09:06 +00:00 коммит произвёл James Graham
Родитель bbddc94b2b
Коммит 682e1812d3
4 изменённых файлов: 39 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,8 @@
<!doctype html>
<script>
window.addEventListener("message", e => {
window.top.postMessage(e.data, "*");
});
</script>
<iframe src="secure-connection-test.html">

Просмотреть файл

@ -0,0 +1,3 @@
Connection: Keep-Alive
Content-Length: 170

Просмотреть файл

@ -0,0 +1,13 @@
<!doctype html>
<script>
const entries = performance.getEntriesByType("navigation");
if (!entries) {
window.top.postMessage("FAIL - not supported", "*");
}
const entry = entries[0];
if (entry.secureConnectionStart != entry.fetchStart) {
window.top.postMessage("FAIL - unexpected secureConnectionStart value of " +
entry.secureConnectionStart + " does not equal " + entry.fetchStart, "*");
}
window.top.postMessage("PASS", "*");
</script>

Просмотреть файл

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Navigation Timing secureconnectionstart reuse</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
const t = async_test("Test that secureConnectionStart value is as expected when reused");
window.addEventListener("message", t.step_func_done(e => {
assert_equals(e.data, "PASS");
}));
</script>
<iframe src="resources/secure-connection-interim.html">