Chromium Code Reviews| Index: LayoutTests/http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_cross_origin_redirect_chain.html |
| diff --git a/LayoutTests/http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_cross_origin_resource_request.html b/LayoutTests/http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_cross_origin_redirect_chain.html |
| similarity index 54% |
| copy from LayoutTests/http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_cross_origin_resource_request.html |
| copy to LayoutTests/http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_cross_origin_redirect_chain.html |
| index 06f74a6ec7310b4364d6551f42778e70f37926cf..9710083b44c339ed1e057057371b2532d571544d 100644 |
| --- a/LayoutTests/http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_cross_origin_resource_request.html |
| +++ b/LayoutTests/http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_cross_origin_redirect_chain.html |
| @@ -2,7 +2,7 @@ |
| <html> |
| <head> |
| <meta charset="utf-8" /> |
| - <title>resource timing information for cross-origin resource request</title> |
| + <title>resource timing information for 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> |
| @@ -11,47 +11,45 @@ |
| <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_timer() |
| + { |
| + setTimeout(onload_test, 1000); |
| + } |
| function onload_test() |
| { |
| - var context = new PerformanceContext(performance); |
| + var context = new PerformanceContext(performance); |
| var entry = context.getEntriesByName(document.getElementById("frameContext").src, "resource")[0]; |
| - test_equals(entry.redirectStart, 0, "redirectStart should be 0 in cross-origin request!"); |
| - test_equals(entry.redirectEnd, 0, "redirectEnd should be 0 in cross-origin request!"); |
| - test_equals(entry.domainLookupStart, 0, "domainLookupStart should be 0 in cross-origin request!"); |
| - test_equals(entry.domainLookupEnd, 0, "domainLookupEnd should be 0 in cross-origin request!"); |
| - test_equals(entry.connectStart, 0, "connectStart should be 0 in cross-origin request!"); |
| - test_equals(entry.connectEnd, 0, "connectEnd should be 0 in cross-origin request!"); |
| - test_equals(entry.requestStart, 0, "requestStart should be 0 in cross-origin request!"); |
| - test_equals(entry.responseStart, 0, "responseStart should be 0 in cross-origin request!"); |
| - test_equals(entry.secureConnectionStart, 0, "secureConnectionStart should be 0 in cross-origin request!"); |
| - test_greater_than(entry.fetchStart, 0, "fetchStart should be greater than 0 in cross-origin request!"); |
| - test_greater_than(entry.responseEnd, 0, "responseEnd should be greater than 0 in cross-origin request!"); |
| + test_equals(entry.redirectStart, 0, "redirectStart should be 0 in cross-origin redirect! "); |
| + test_equals(entry.redirectEnd, 0, "redirectEnd should be 0 in cross-origin redirect! "); |
| + test_greater_or_equals(entry.fetchStart - 3000, 0, "fetchStart should be 3 secs later than navigationStart"); |
|
James Simonsen
2013/05/20 23:31:37
I think it'd be easier to read if the 3000 was the
Pan
2013/06/03 10:17:34
Agree, done.
|
| + test_equals(entry.startTime, entry.fetchStart, "startTime should be the same to fetchStart in cross-origin redirect!"); |
| done(); |
| } |
| - |
| </script> |
| </head> |
| <body> |
| <h1>Description</h1> |
| - <p>This test validates the values in resource timing for a cross-origin resource request.</p> |
| - |
| - <br /> |
| + <p>This test validates the values in resource timing for 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/blank_page_green.htm'; |
| + var destUrl = 'http://' + crossOrigin + '/w3c/webperf/resources/multi_redirect.php?'; |
| + destUrl += 'pageOrigin=' + 'http://' +pageOrigin; |
|
James Simonsen
2013/05/20 23:31:37
Spaces around +.
|
| + destUrl += '&crossOrigin=' + 'http://' +crossOrigin; |
| + destUrl += '&timingAllow=' + 0; |
|
James Simonsen
2013/05/20 23:31:37
Just put 0 in the string.
|
| var frameContext = document.getElementById("frameContext"); |
| - frameContext.onload = onload_test; |
| + frameContext.onload = onload_timer; |
| frameContext.src = destUrl; |
| </script> |
| + <div id="log"></div> |
| </body> |
| </html> |