Bug 1477877 [wpt PR 12149] - Adding tests against and fixes for tabs in Server-Timing headers, a=testonly

Automatic update from web-platform-testsAdding tests against and fixes for tabs in Server-Timing headers

According to the spec
(https://w3c.github.io/server-timing/#the-server-timing-header-field),
optional whitespace is allowed amongst parameter names and values. We
should be discarding this whitespace during parsing but, when there are
tabs, we were treating it like an error and discarding the whole value.

Changed the code that tokenizes HTTP headers to skip tabs and spaces
when consuming optional whitespace.

BUG=798446

Change-Id: If776761e5ea199e662ec7b2b5aa245e4581131fd
Reviewed-on: https://chromium-review.googlesource.com/1147258
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Tom McKee <tommckee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577325}

--

wpt-commits: 4ec913040882c7bb28846a65e7e086785dcf2ab6
wpt-pr: 12149
This commit is contained in:
Tom McKee 2018-07-25 21:16:11 +00:00 committed by James Graham
parent e9c8f95471
commit 9f01a06e5e
5 changed files with 24 additions and 4 deletions

View File

@ -294449,6 +294449,16 @@
{}
]
],
"server-timing/resources/parsing/84.js": [
[
{}
]
],
"server-timing/resources/parsing/84.js.sub.headers": [
[
{}
]
],
"server-timing/resources/parsing/9.js": [
[
{}
@ -613988,6 +613998,14 @@
"ba24e1d89104fb25d5100dfa0b38388ca19ee9c1",
"support"
],
"server-timing/resources/parsing/84.js": [
"aa4b60a397c4704689621874403329c705598c9c",
"support"
],
"server-timing/resources/parsing/84.js.sub.headers": [
"94fd8cac84f6fdc22d8b46786ac690f788e657f4",
"support"
],
"server-timing/resources/parsing/9.js": [
"5660bb21eb42f322a58f80c6c001d14c6e0fc0c9",
"support"
@ -613997,11 +614015,11 @@
"support"
],
"server-timing/server_timing_header-parsing.html": [
"7ec595af5a8c240c0fe0a4b10469fd11e2f56cbf",
"8df39d7b393cb0ae6dac1997b2d8755210a97ea5",
"testharness"
],
"server-timing/server_timing_header-parsing.https.html": [
"7ec595af5a8c240c0fe0a4b10469fd11e2f56cbf",
"8df39d7b393cb0ae6dac1997b2d8755210a97ea5",
"testharness"
],
"server-timing/service_worker_idl.https.html": [

View File

@ -0,0 +1 @@
testServerTiming(document.currentScript, [{"name":"metric", "desc":"tabs-should-get-trimmed", "dur": 42.0}])

View File

@ -0,0 +1 @@
Server-Timing: metric; desc= tabs-should-get-trimmed ;dur= 42

View File

@ -43,7 +43,7 @@ tests generated by:
})
done()
}
for (let i = 0; i <= 83; i++) {
for (let i = 0; i <= 84; i++) {
const script = document.createElement('script')
script.src = `./resources/parsing/${i}.js`
document.getElementsByTagName('head')[0].appendChild(script)

View File

@ -43,7 +43,7 @@ tests generated by:
})
done()
}
for (let i = 0; i <= 83; i++) {
for (let i = 0; i <= 84; i++) {
const script = document.createElement('script')
script.src = `./resources/parsing/${i}.js`
document.getElementsByTagName('head')[0].appendChild(script)