Index: LayoutTests/http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_cross_origin_redirect_chain_allow_timing.html |
diff --git a/LayoutTests/http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_cross_origin_redirect_chain_allow_timing.html b/LayoutTests/http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_cross_origin_redirect_chain_allow_timing.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..02afdf4c43b46dac6ca7d69af4bf2dfa3d949be2 |
--- /dev/null |
+++ b/LayoutTests/http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_cross_origin_redirect_chain_allow_timing.html |
@@ -0,0 +1,51 @@ |
+<!DOCTYPE HTML> |
+<html> |
+ <head> |
+ <meta charset="utf-8" /> |
+ <title>resource timing information for timing allowed cross-origin redirect chain</title> |
+ <link rel="author" title="Intel" href="http://www.intel.com/" /> |
+ <link rel="help" href="http://www.w3.org/TR/resource-timing/#performanceresourcetiming"/> |
+ <script src="/w3c/resources/testharness.js"></script> |
+ <script src="/w3c/resources/testharnessreport.js"></script> |
+ <script src="/w3c/webperf/resources/webperftestharness.js"></script> |
+ <script src="/w3c/webperf/resources/webperftestharnessextension.js"></script> |
+ |
+ <script> |
+ setup({explicit_done: true}); |
+ setup({timeout: 30000}); |
+ test_namespace(); |
+ var pageOrigin = "127.0.0.1:8000"; |
+ var crossOrigin = "localhost:8000"; |
+ |
+ function onload_test() |
+ { |
+ var context = new PerformanceContext(performance); |
+ var entry = context.getEntriesByName(document.getElementById("frameContext").src, "resource")[0]; |
+ |
+ test_greater_than(entry.redirectStart, 0, "redirectStart should be greater than 0 in timing allowed cross-origin redirect! "); |
+ test_equals(entry.redirectStart, entry.startTime, "redirectStart should be equal to startTime in timing allowed cross-origin redirect!"); |
+ test_greater_or_equals(entry.redirectEnd, entry.redirectStart + 3000, "redirectEnd should be 3 secs later than redirectStart"); |
+ test_greater_or_equals(entry.fetchStart, entry.redirectEnd, "fetchStart should be no less than redirectEnd in timing allowed cross-origin redirect!"); |
+ done(); |
+ } |
+ </script> |
+ |
+ </head> |
+ <body> |
+ <h1>Description</h1> |
+ <p>This test validates the values in resource timing for a timing allowed cross-origin redirect chain.</p> |
+ <iframe id="frameContext" src="" style="width: 250px; height: 250px;"></iframe> |
+ <script> |
+ test_equals(document.location.host, pageOrigin, 'Starting document.location.hostname is correct (' + pageOrigin + ')'); |
+ |
+ var destUrl = 'http://' + crossOrigin + '/w3c/webperf/resources/multi_redirect.php?'; |
+ destUrl += 'pageOrigin=' + 'http://' + pageOrigin; |
+ destUrl += '&crossOrigin=' + 'http://' + crossOrigin; |
+ destUrl += '&timingAllow=1'; |
+ var frameContext = document.getElementById("frameContext"); |
+ frameContext.onload = onload_test; |
+ frameContext.src = destUrl; |
+ </script> |
+ <div id="log"></div> |
+ </body> |
+</html> |