Fix the |name| of PerformanceNavigationTiming
Previously, the |name| of a PerformanceNavigationTiming entry was the initial
URL (the request URL). After this CL, it is the response URL, so for example
a url of the form 'redirect?location=newLoc' will have 'newLoc' as the |name|.
Bug: 797465
Change-Id: Icab53ad8027d066422562c82bcf0354c264fea40
Reviewed-on: https://chromium-review.googlesource.com/996579
Reviewed-by: Yoav Weiss <yoav@yoav.ws>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548773}
diff --git a/navigation-timing/nav2_test_redirect_server.html b/navigation-timing/nav2_test_redirect_server.html
index 41b24dd..1d7f6c9 100644
--- a/navigation-timing/nav2_test_redirect_server.html
+++ b/navigation-timing/nav2_test_redirect_server.html
@@ -11,7 +11,7 @@
<script>
function verifyTimingEventOrder(eventOrder, timingEntry) {
- for (var i = 0; i < eventOrder.length - 1; i++) {
+ for (let i = 0; i < eventOrder.length - 1; i++) {
assert_true(timingEntry[eventOrder[i]] < timingEntry[eventOrder[i + 1]],
"Expected " + eventOrder[i] + " to be no greater than " + eventOrder[i + 1] + ".");
}
@@ -19,11 +19,13 @@
function onload_test()
{
- var frame_performance = document.getElementById("frameContext").contentWindow.performance;
- assert_equals(frame_performance.getEntriesByType("navigation")[0].type,
+ const frame_performance = document.getElementById("frameContext").contentWindow.performance;
+ const navigation_entry = frame_performance.getEntriesByType("navigation")[0];
+ assert_equals(navigation_entry.type,
"navigate",
"Expected navigation type to be navigate.");
- assert_equals(frame_performance.getEntriesByType("navigation")[0].redirectCount, 1, "Expected redirectCount to be 1.");
+ assert_equals(navigation_entry.redirectCount, 1, "Expected redirectCount to be 1.");
+ assert_equals(navigation_entry.name, 'http://' + document.location.host + '/navigation-timing/resources/blank_page_green.html');
var timgingEvents = [
'startTime',