Bug 1460298 [wpt PR 10901] - Server-Timing: test PerformanceResourceTiming.idl from Service Worker, a=testonly
authorYoav Weiss <yoav@yoav.ws>
Tue, 15 May 2018 13:32:56 +0000
changeset 418488 b58bbbe8dd264c5ab056e5af245a89339f662f28
parent 418487 394a5ad2313c16a204d117b61ba89be32db06f2d
child 418489 b6f443bc0763622e0c969b40758b344be28740c2
push id103318
push userwptsync@mozilla.com
push dateWed, 16 May 2018 15:06:09 +0000
treeherdermozilla-inbound@51f1ecd79ebe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1460298, 10901
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1460298 [wpt PR 10901] - Server-Timing: test PerformanceResourceTiming.idl from Service Worker, a=testonly Automatic update from web-platform-testsMerge pull request #10901 from cvazac/cvazac/service-worker Server-Timing: test PerformanceResourceTiming.idl from Service Worker -- wpt-commits: 2a099e21421546a037347e0826acd09be9410a87 wpt-pr: 10901
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/server-timing/service_worker_idl.html
testing/web-platform/tests/server-timing/sw.js
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -294989,16 +294989,21 @@
      {}
     ]
    ],
    "server-timing/resources/parsing/9.js.sub.headers": [
     [
      {}
     ]
    ],
+   "server-timing/sw.js": [
+    [
+     {}
+    ]
+   ],
    "server-timing/test_server_timing.html.sub.headers": [
     [
      {}
     ]
    ],
    "server-timing/test_server_timing.https.html.sub.headers": [
     [
      {}
@@ -365908,16 +365913,22 @@
     ]
    ],
    "server-timing/server_timing_header-parsing.https.html": [
     [
      "/server-timing/server_timing_header-parsing.https.html",
      {}
     ]
    ],
+   "server-timing/service_worker_idl.html": [
+    [
+     "/server-timing/service_worker_idl.html",
+     {}
+    ]
+   ],
    "server-timing/test_server_timing.html": [
     [
      "/server-timing/test_server_timing.html",
      {}
     ]
    ],
    "server-timing/test_server_timing.https.html": [
     [
@@ -602251,16 +602262,24 @@
   "server-timing/server_timing_header-parsing.html": [
    "10f756bbf749b7ad8f7c6eb4efe752ee79c44b4a",
    "testharness"
   ],
   "server-timing/server_timing_header-parsing.https.html": [
    "10f756bbf749b7ad8f7c6eb4efe752ee79c44b4a",
    "testharness"
   ],
+  "server-timing/service_worker_idl.html": [
+   "cb5ea3136399f88fb6c4e8071ad8e3b7ccebb242",
+   "testharness"
+  ],
+  "server-timing/sw.js": [
+   "0c12328f152814e2f0bde7fe026cf12c8ea77ff0",
+   "support"
+  ],
   "server-timing/test_server_timing.html": [
    "7c778ca856e5cff0bbc785f59c9ccf1ec86456fb",
    "testharness"
   ],
   "server-timing/test_server_timing.html.sub.headers": [
    "77000d65537ef522a3471002118a120d2faf296a",
    "support"
   ],
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/server-timing/service_worker_idl.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<head>
+    <meta charset='utf-8' />
+    <script src="/resources/testharness.js"></script>
+    <script src='/resources/testharnessreport.js'></script>
+    <script>
+      (async () => {
+        const scope = 'does/not/exist'
+
+        let registration = await navigator.serviceWorker.getRegistration(scope)
+        if (registration)
+          await registration.unregister()
+        registration = await navigator.serviceWorker.register('./sw.js', {scope})
+
+        fetch_tests_from_worker(registration.installing)
+      })()
+    </script>
+</head>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/server-timing/sw.js
@@ -0,0 +1,10 @@
+importScripts('/resources/testharness.js')
+
+promise_test(async (test) => {
+  return fetch('./sw.js').then(function(response) {
+    assert_not_equals(typeof performance.getEntriesByName(response.url)[0].serverTiming,
+      'undefined',
+      'An instance of `PerformanceResourceTiming` should have a `serverTiming` attribute in the Service Worker context.')
+    done()
+  })
+})