Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Unified Diff: LayoutTests/http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_same_origin_redirect.html

Issue 13912021: [Resource Timing] Expose redirect timing information (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebaseline Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_same_origin_redirect.html
diff --git a/LayoutTests/http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_same_origin_redirect.html b/LayoutTests/http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_same_origin_redirect.html
new file mode 100644
index 0000000000000000000000000000000000000000..4c44fb60bfeabf7c14482dbb3458b51f617c111e
--- /dev/null
+++ b/LayoutTests/http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_same_origin_redirect.html
@@ -0,0 +1,47 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>redirectStart and redirectEnd information in same-origin redirect resource timing</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});
+ var pageOrigin = "127.0.0.1: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 same-origin redirect!");
+ test_equals(entry.redirectStart, entry.startTime, "redirectStart should be equal to startTime in same-origin redirect!");
+ test_noless_than(entry.redirectEnd, entry.redirectStart, "redirectEnd should be no less than redirectStart in same-origin redirect!");
+ test_noless_than(entry.fetchStart, entry.redirectEnd, "fetchStart should be no less than redirectEnd in same-origin redirect!");
+ done();
+ }
+ </script>
+
+ </head>
+ <body>
+ <h1>Description</h1>
+ <p>This test validates the values of the redirectStart/End in resource timing for a same-origin resource redirect.</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://' + pageOrigin + '/w3c/webperf/resources/redirect.php';
+ destUrl += '?location=http://' + pageOrigin + "/w3c/webperf/resources/blank_page_green.htm";
+
+ var frameContext = document.getElementById("frameContext");
+ frameContext.onload = onload_test;
+ frameContext.src = destUrl;
+ </script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698