[WPT] Update resource-timing WPT tests to use the right cross origin
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Oct 2018 07:24:59 +0000 (07:24 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Oct 2018 07:24:59 +0000 (07:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=190554

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* web-platform-tests/resource-timing/resource_TAO_cross_origin_redirect_chain-expected.txt:
* web-platform-tests/resource-timing/resource_TAO_cross_origin_redirect_chain.html:
* web-platform-tests/resource-timing/resource_timing_cross_origin_redirect_chain-expected.txt:
* web-platform-tests/resource-timing/resource_timing_cross_origin_redirect_chain.html:

LayoutTests:

* TestExpectations:

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

LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_TAO_cross_origin_redirect_chain-expected.txt
LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_TAO_cross_origin_redirect_chain.html
LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_cross_origin_redirect_chain-expected.txt
LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_cross_origin_redirect_chain.html

index 6c59940..82f2dcf 100644 (file)
@@ -1,3 +1,12 @@
+2018-10-25  Jiewen Tan  <jiewen_tan@apple.com>
+
+        [WPT] Update resource-timing WPT tests to use the right cross origin
+        https://bugs.webkit.org/show_bug.cgi?id=190554
+
+        Reviewed by Youenn Fablet.
+
+        * TestExpectations:
+
 2018-10-24  Tim Horton  <timothy_horton@apple.com>
 
         Attachment filenames with RTL characters should format similar to Finder
index 00984b4..17f7703 100644 (file)
@@ -358,6 +358,7 @@ webkit.org/b/180240 imported/w3c/web-platform-tests/resource-timing/single-entry
 webkit.org/b/189906 imported/w3c/web-platform-tests/resource-timing/resource_timing_buffer_full_eventually.html [ Skip ]
 webkit.org/b/189905 imported/w3c/web-platform-tests/resource-timing/resource_initiator_types.html [ Pass Failure ]
 webkit.org/b/189910 imported/w3c/web-platform-tests/resource-timing/resource_timing_store_and_clear_during_callback.html [ Pass Failure ]
+webkit.org/b/190523 imported/w3c/web-platform-tests/resource-timing/resource_timing_cross_origin_redirect_chain.html [ Pass Failure ]
 
 # The follow two tests change their output each run
 imported/w3c/web-platform-tests/fetch/api/abort/general.any.html [ Skip ]
index c77508f..dc92ce6 100644 (file)
@@ -1,3 +1,15 @@
+2018-10-25  Jiewen Tan  <jiewen_tan@apple.com>
+
+        [WPT] Update resource-timing WPT tests to use the right cross origin
+        https://bugs.webkit.org/show_bug.cgi?id=190554
+
+        Reviewed by Youenn Fablet.
+
+        * web-platform-tests/resource-timing/resource_TAO_cross_origin_redirect_chain-expected.txt:
+        * web-platform-tests/resource-timing/resource_TAO_cross_origin_redirect_chain.html:
+        * web-platform-tests/resource-timing/resource_timing_cross_origin_redirect_chain-expected.txt:
+        * web-platform-tests/resource-timing/resource_timing_cross_origin_redirect_chain.html:
+
 2018-10-22  Justin Michaud  <justin_michaud@apple.com>
 
         Registered custom properties should support syntax parameter for <length> and *
index 91d95c4..ff30313 100644 (file)
@@ -1,10 +1,10 @@
-Blocked access to external URL http://www.localhost:8800/resource-timing/resources/multi_redirect.py?page_origin=http://localhost:8800&cross_origin=http://www.localhost:8800&timing_allow=1
-CONSOLE MESSAGE: line 26: TypeError: undefined is not an object (evaluating 'entry.redirectStart')
 
 
-Harness Error (FAIL), message = TypeError: undefined is not an object (evaluating 'entry.redirectStart')
-
 PASS window.performance is defined 
 PASS window.performance.getEntriesByName is defined 
-FAIL There should be one entry. assert_equals: There should be one entry. expected 1 but got 0
+PASS There should be one entry. 
+PASS redirectStart > 0 in timing allowed cross-origin redirect. 
+PASS redirectStart == startTime in timing allowed cross-origin redirect. 
+PASS redirectEnd > redirectStart in timing allowed cross-origin redirect. 
+PASS fetchStart >= redirectEnd in timing allowed cross-origin redirect. 
 
index af3d31e..5221882 100644 (file)
@@ -7,14 +7,13 @@
 <link rel="help" href="http://www.w3.org/TR/resource-timing/#performanceresourcetiming"/>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
+<script src=/common/get-host-info.sub.js></script>
 <script src="resources/webperftestharness.js"></script>
 <script src="resources/webperftestharnessextension.js"></script>
 
 <script>
     setup({explicit_done: true});
     test_namespace('getEntriesByName');
-    const pageOrigin = document.location.host;
-    const crossOrigin = 'www.' + pageOrigin;
 
     function onload_test()
     {
@@ -35,9 +34,9 @@
 <body>
 <iframe id="frameContext" src="" style="width: 250px; height: 250px;"></iframe>
 <script>
-    let destUrl = 'http://' + crossOrigin + '/resource-timing/resources/multi_redirect.py?';
-    destUrl += 'page_origin=' + 'http://' + pageOrigin;
-    destUrl += '&cross_origin=' + 'http://' + crossOrigin;
+    let destUrl = get_host_info().HTTP_REMOTE_ORIGIN + '/resource-timing/resources/multi_redirect.py?';
+    destUrl += 'page_origin=' + 'http://' + document.location.host;
+    destUrl += '&cross_origin=' + get_host_info().HTTP_REMOTE_ORIGIN;
     destUrl += '&timing_allow=1';
     const frameContext = document.getElementById('frameContext');
     frameContext.onload = onload_test;
index b46f1b5..1e24511 100644 (file)
@@ -1,10 +1,10 @@
-Blocked access to external URL http://www.localhost:8800/resource-timing/resources/multi_redirect.py?page_origin=http://localhost:8800&cross_origin=http://www.localhost:8800
-CONSOLE MESSAGE: line 26: TypeError: undefined is not an object (evaluating 'entry.redirectStart')
 
 
-Harness Error (FAIL), message = TypeError: undefined is not an object (evaluating 'entry.redirectStart')
-
 PASS window.performance is defined 
 PASS window.performance.getEntriesByName is defined 
-FAIL There should be one entry. assert_equals: There should be one entry. expected 1 but got 0
+PASS There should be one entry. 
+FAIL redirectStart == 0 in cross-origin redirect. assert_equals: redirectStart == 0 in cross-origin redirect. expected 0 but got 889
+FAIL redirectEnd == 0 in cross-origin redirect. assert_equals: redirectEnd == 0 in cross-origin redirect. expected 0 but got 955.0000000000001
+PASS fetchStart > 0 in cross-origin redirect. 
+FAIL startTime == fetchStart in cross-origin redirect. assert_equals: startTime == fetchStart in cross-origin redirect. expected 955.0000000000001 but got 889
 
index 2a7b2f7..5675f20 100644 (file)
@@ -7,14 +7,13 @@
 <link rel="help" href="http://www.w3.org/TR/resource-timing/#performanceresourcetiming"/>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
+<script src=/common/get-host-info.sub.js></script>
 <script src="resources/webperftestharness.js"></script>
 <script src="resources/webperftestharnessextension.js"></script>
 
 <script>
     setup({explicit_done: true});
     test_namespace('getEntriesByName');
-    const pageOrigin = document.location.host;
-    const crossOrigin = 'www.' + pageOrigin;
 
     function onload_test()
     {
@@ -35,9 +34,9 @@
 <body>
 <iframe id="frameContext" src="" style="width: 250px; height: 250px;"></iframe>
 <script>
-    let destUrl = 'http://' + crossOrigin + '/resource-timing/resources/multi_redirect.py?';
-    destUrl += 'page_origin=' + 'http://' + pageOrigin;
-    destUrl += '&cross_origin=' + 'http://' + crossOrigin;
+    let destUrl = get_host_info().HTTP_REMOTE_ORIGIN + '/resource-timing/resources/multi_redirect.py?';
+    destUrl += 'page_origin=' + 'http://' + document.location.host;
+    destUrl += '&cross_origin=' + get_host_info().HTTP_REMOTE_ORIGIN;
     const frameContext = document.getElementById('frameContext');
     frameContext.onload = onload_test;
     frameContext.src = destUrl;