Update web-platform-tests/resource-timing
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Oct 2018 00:15:40 +0000 (00:15 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Oct 2018 00:15:40 +0000 (00:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=190550

Reviewed by Youenn Fablet.

* resources/import-expectations.json:
* web-platform-tests/resource-timing/resource_initiator_types-expected.txt:
* web-platform-tests/resource-timing/resource_subframe_self_navigation-expected.txt:
* web-platform-tests/resource-timing/resource_timing_buffer_full_eventually.html:
* web-platform-tests/resource-timing/resources/TAOResponse.py:
(main):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237341 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/resources/import-expectations.json
LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_initiator_types-expected.txt
LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_buffer_full_eventually.html
LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/TAOResponse.py

index 9a55b27..3b8d0d4 100644 (file)
@@ -1,3 +1,17 @@
+2018-10-12  Jiewen Tan  <jiewen_tan@apple.com>
+
+        Update web-platform-tests/resource-timing
+        https://bugs.webkit.org/show_bug.cgi?id=190550
+
+        Reviewed by Youenn Fablet.
+
+        * resources/import-expectations.json:
+        * web-platform-tests/resource-timing/resource_initiator_types-expected.txt:
+        * web-platform-tests/resource-timing/resource_subframe_self_navigation-expected.txt:
+        * web-platform-tests/resource-timing/resource_timing_buffer_full_eventually.html:
+        * web-platform-tests/resource-timing/resources/TAOResponse.py:
+        (main):
+
 2018-10-20  YUHAN WU  <yuhan_wu@apple.com>
 
         MediaRecorder should fire a stop event when all tracks are ended
index 10582fe..e22b5ba 100644 (file)
     "web-platform-tests/worklets": "skip", 
     "web-platform-tests/x-frame-options": "skip", 
     "web-platform-tests/xhr": "import"
-}
+}
\ No newline at end of file
index ee7b2e3..070865f 100644 (file)
@@ -21,6 +21,7 @@ PASS http://localhost:8800/resource-timing/resources/blue.png?id=picture-notsupp
 PASS http://localhost:8800/resource-timing/resources/blue.png?id=picture-source is expected to have initiatorType img 
 PASS http://localhost:8800/resource-timing/resources/blue.png?id=svg-image is expected to have initiatorType image 
 PASS http://localhost:8800/resource-timing/resources/blue.png?id=video-poster is expected to have initiatorType video 
+PASS http://localhost:8800/resource-timing/resources/empty.py?id=audio-source-mpeg is expected to have initiatorType audio 
 PASS http://localhost:8800/resource-timing/resources/empty.py?id=audio-source-wav is expected to have initiatorType audio 
 PASS http://localhost:8800/resource-timing/resources/empty.py?id=audio-src is expected to have initiatorType audio 
 PASS http://localhost:8800/resource-timing/resources/empty.py?id=fetch is expected to have initiatorType fetch 
index 7ca8237..ce74523 100644 (file)
         function() {
             // Scripts appended in JS to ensure setResourceTimingBufferSize is called before.
             let counter = performance.getEntriesByType("resource").length;
-            function appendScript() {
-                const src = "resources/empty.js?" + counter;
-                const script = document.createElement('script');
-                script.type = 'text/javascript';
-                script.onload = function() { ++counter; appendScript()};
-                script.src = src;
-                document.body.appendChild(script);
+            function appendScripts() {
+                const documentFragment = document.createDocumentFragment();
+                // Add 100 elements at a time to avoid page reflow every time.
+                let numScriptsAccumulated = 0;
+                while (numScriptsAccumulated < 100) {
+                    const src = "resources/empty.js?" + counter;
+                    const script = document.createElement('script');
+                    script.type = 'text/javascript';
+                    script.src = src;
+                    documentFragment.appendChild(script);
+                    ++counter;
+                    ++numScriptsAccumulated;
+                }
+                document.body.appendChild(documentFragment);
+                t.step_timeout(appendScripts, 20);
             }
-            appendScript();
+            appendScripts();
         });
 </script>
 </body>
index 060f9b0..fefc75b 100644 (file)
@@ -17,22 +17,22 @@ def main(request, response):
     # case-sensitive match for origin, pass
         response.headers.set('Timing-Allow-Origin', origin)
     elif tao == 'space':
-    # space seperated list of origin and wildcard, fail
+    # space separated list of origin and wildcard, fail
         response.headers.set('Timing-Allow-Origin', (origin + ' *'))
     elif tao == 'multi':
-    # more than one TAO values, seperated by comma, pass
+    # more than one TAO values, separated by comma, pass
         response.headers.set('Timing-Allow-Origin', origin)
         response.headers.append('Timing-Allow-Origin', '*')
     elif tao == 'multi_wildcard':
-    # multiple wildcards, seperated by comma, pass
+    # multiple wildcards, separated by comma, pass
         response.headers.set('Timing-Allow-Origin', '*')
         response.headers.append('Timing-Allow-Origin', '*')
     elif tao == 'match_origin':
-    # contains a match of origin, seperated by comma, pass
+    # contains a match of origin, separated by comma, pass
         response.headers.set('Timing-Allow-Origin', origin)
         response.headers.append('Timing-Allow-Origin', "fake")
     elif tao == 'match_wildcard':
-    # contains a wildcard, seperated by comma, pass
+    # contains a wildcard, separated by comma, pass
         response.headers.set('Timing-Allow-Origin', "fake")
         response.headers.append('Timing-Allow-Origin', '*')
     elif tao == 'uppercase':