Commit 87e204e0 authored by Nicolas Pena's avatar Nicolas Pena Committed by Commit Bot

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/996579Reviewed-by: default avatarYoav Weiss <yoav@yoav.ws>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548773}
parent 36baddf2
......@@ -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',
......
......@@ -21,10 +21,11 @@ PerformanceNavigationTiming::PerformanceNavigationTiming(
ResourceTimingInfo* info,
TimeTicks time_origin,
const WebVector<WebServerTimingInfo>& server_timing)
: PerformanceResourceTiming(info ? info->InitialURL().GetString() : "",
"navigation",
time_origin,
server_timing),
: PerformanceResourceTiming(
info ? info->FinalResponse().Url().GetString() : "",
"navigation",
time_origin,
server_timing),
ContextClient(frame),
resource_timing_info_(info) {
DCHECK(frame);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment