Commit 6edf709c authored by Andrey Kosyakov's avatar Andrey Kosyakov Committed by Commit Bot

Fix http/tests/inspector-protocol/network/multiple-headers.js to use same-origin request

We accidentally used a CORS fetch() to a resource that dit not allow CORS access in the test,
expecting Network.loadingFinished to happen after the resource is loaded. However, with
per-message dispatch tasks (https://chromium-review.googlesource.com/c/chromium/src/+/1145692),
the request is cancelled before we receive loadingFinished, so we now get loadingFailed
with net::ERR_ABORTED instead.

Bug: 872081
Change-Id: I9cfd6c8ebc49f1e835916fb87f4d6cea0e4262b1
Reviewed-on: https://chromium-review.googlesource.com/1168185
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: default avatarKen Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582014}
parent 6b625f83
Tests that multiple HTTP headers with same name are correctly folded into one LF-separated line.
Pragma header of fetch of http://localhost:8000/inspector-protocol/network/resources/multiple-headers.php?fetch=1: value1, value2
Pragma header of navigation to http://localhost:8000/inspector-protocol/network/resources/multiple-headers.php: value1
value2
Tests that multiple HTTP headers with same name are correctly folded into one LF-separated line. Tests that multiple HTTP headers with same name are correctly folded into one LF-separated line.
Pragma header of fetch of http://localhost:8000/inspector-protocol/network/resources/multiple-headers.php?fetch=1: value1 Pragma header of fetch of http://127.0.0.1:8000/inspector-protocol/network/resources/multiple-headers.php?fetch=1: value1
value2 value2
Pragma header of navigation to http://localhost:8000/inspector-protocol/network/resources/multiple-headers.php: value1 Pragma header of navigation to http://127.0.0.1:8000/inspector-protocol/network/resources/multiple-headers.php: value1
value2 value2
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
'../resources/test-page.html', '../resources/test-page.html',
`Tests that multiple HTTP headers with same name are correctly folded into one LF-separated line.`); `Tests that multiple HTTP headers with same name are correctly folded into one LF-separated line.`);
const url = 'http://localhost:8000/inspector-protocol/network/resources/multiple-headers.php'; const url = 'http://127.0.0.1:8000/inspector-protocol/network/resources/multiple-headers.php';
await dp.Network.enable(); await dp.Network.enable();
await dp.Page.enable(); await dp.Page.enable();
session.evaluate(`fetch("${url}?fetch=1")`); session.evaluate(`fetch("${url}?fetch=1").then(r => r.text())`);
const fetchResponse = (await dp.Network.onceResponseReceived()).params.response; const fetchResponse = (await dp.Network.onceResponseReceived()).params.response;
testRunner.log(`Pragma header of fetch of ${fetchResponse.url}: ${fetchResponse.headers['Access-Control-Pragma']}`); testRunner.log(`Pragma header of fetch of ${fetchResponse.url}: ${fetchResponse.headers['Access-Control-Pragma']}`);
await dp.Network.onceLoadingFinished(); await dp.Network.onceLoadingFinished();
......
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