Bug 1477877 [wpt PR 12149] - Adding tests against and fixes for tabs in Server-Timing headers, a=testonly
authorTom McKee <tommckee@chromium.org>
Wed, 25 Jul 2018 21:16:11 +0000
changeset 824168 59df66945988462e5426d638849330b6e5929c81
parent 824167 6ee33795ab2d2a1e9470e5a2300dd1bfe8492397
child 824169 8f4a236178f9b248c84ee35bacc50a33af738605
push id117837
push userbmo:aryx.bugmail@gmx-topmail.de
push dateMon, 30 Jul 2018 09:42:15 +0000
reviewerstestonly
bugs1477877, 12149, 798446, 1147258, 577325
milestone63.0a1
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
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/server-timing/resources/parsing/84.js
testing/web-platform/tests/server-timing/resources/parsing/84.js.sub.headers
testing/web-platform/tests/server-timing/server_timing_header-parsing.html
testing/web-platform/tests/server-timing/server_timing_header-parsing.https.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -294444,16 +294444,26 @@
      {}
     ]
    ],
    "server-timing/resources/parsing/83.js.sub.headers": [
     [
      {}
     ]
    ],
+   "server-timing/resources/parsing/84.js": [
+    [
+     {}
+    ]
+   ],
+   "server-timing/resources/parsing/84.js.sub.headers": [
+    [
+     {}
+    ]
+   ],
    "server-timing/resources/parsing/9.js": [
     [
      {}
     ]
    ],
    "server-timing/resources/parsing/9.js.sub.headers": [
     [
      {}
@@ -613983,30 +613993,38 @@
   "server-timing/resources/parsing/83.js": [
    "5d6b847c554a9c38b97f1a540db9375b47b6208f",
    "support"
   ],
   "server-timing/resources/parsing/83.js.sub.headers": [
    "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"
   ],
   "server-timing/resources/parsing/9.js.sub.headers": [
    "6a8feff546c8564268b238e01a0470588b4739e7",
    "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": [
    "cb5ea3136399f88fb6c4e8071ad8e3b7ccebb242",
    "testharness"
   ],
   "server-timing/sw.js": [
    "47e2601a903e34c2c8afc90e544026e8c6d11d05",
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/server-timing/resources/parsing/84.js
@@ -0,0 +1,1 @@
+testServerTiming(document.currentScript, [{"name":"metric", "desc":"tabs-should-get-trimmed", "dur": 42.0}])
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/server-timing/resources/parsing/84.js.sub.headers
@@ -0,0 +1,1 @@
+Server-Timing: metric;	desc=	tabs-should-get-trimmed	;dur=	42	
--- a/testing/web-platform/tests/server-timing/server_timing_header-parsing.html
+++ b/testing/web-platform/tests/server-timing/server_timing_header-parsing.html
@@ -38,17 +38,17 @@ tests generated by:
             test_equals(dur, actual.duration,
                 `${fileName} - ${index}duration (${dur} ?== ${actual.duration})`)
             test_equals(desc, actual.description,
                 `${fileName} - ${index}description (${desc} ?== ${actual.description})`)
           })
         })
         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)
         urlToIndex[script.src] = i
       }
       window.addEventListener('load', runTests)
     </script>
 </head>
--- a/testing/web-platform/tests/server-timing/server_timing_header-parsing.https.html
+++ b/testing/web-platform/tests/server-timing/server_timing_header-parsing.https.html
@@ -38,17 +38,17 @@ tests generated by:
             test_equals(dur, actual.duration,
                 `${fileName} - ${index}duration (${dur} ?== ${actual.duration})`)
             test_equals(desc, actual.description,
                 `${fileName} - ${index}description (${desc} ?== ${actual.description})`)
           })
         })
         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)
         urlToIndex[script.src] = i
       }
       window.addEventListener('load', runTests)
     </script>
 </head>