Bug 919391 - Incorrect Navigation Timing API: performance.timing.responseStart - performance.timing.requestStart < 0 r=baku,jgraham
☠☠ backed out by a77180ae4e06 ☠ ☠
authorValentin Gosu <valentin.gosu@gmail.com>
Thu, 08 Dec 2016 09:37:11 -1000
changeset 325445 b3b5af78a162b11a9a838087c0f6ad3567eeb55e
parent 325444 3ea1f28bd0f3b021b40693d6a3a6f944a9e82420
child 325446 c6face1d7183eea175fd7b00e576d3312f3fd14c
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersbaku, jgraham
bugs919391
milestone53.0a1
Bug 919391 - Incorrect Navigation Timing API: performance.timing.responseStart - performance.timing.requestStart < 0 r=baku,jgraham MozReview-Commit-ID: 6s5FljTQEAB
dom/performance/PerformanceTiming.cpp
testing/web-platform/meta/resource-timing/resource-timing.html.ini
testing/web-platform/meta/resource-timing/test_resource_timing.html.ini
testing/web-platform/tests/resource-timing/resources/gzip_xml.py
--- a/dom/performance/PerformanceTiming.cpp
+++ b/dom/performance/PerformanceTiming.cpp
@@ -310,16 +310,21 @@ PerformanceTiming::ResponseStartHighRes(
 {
   if (!nsContentUtils::IsPerformanceTimingEnabled() || !IsInitialized()) {
     return mZeroTime;
   }
   if (mResponseStart.IsNull() ||
      (!mCacheReadStart.IsNull() && mCacheReadStart < mResponseStart)) {
     mResponseStart = mCacheReadStart;
   }
+
+  if (mResponseStart.IsNull() ||
+      (!mRequestStart.IsNull() && mResponseStart < mRequestStart)) {
+    mResponseStart = mRequestStart;
+  }
   return TimeStampToDOMHighResOrFetchStart(mResponseStart);
 }
 
 DOMTimeMilliSec
 PerformanceTiming::ResponseStart()
 {
   return static_cast<int64_t>(ResponseStartHighRes());
 }
deleted file mode 100644
--- a/testing/web-platform/meta/resource-timing/resource-timing.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[resource-timing.html]
-  type: testharness
-  disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1290858
deleted file mode 100644
--- a/testing/web-platform/meta/resource-timing/test_resource_timing.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[test_resource_timing.html]
-  type: testharness
-  [PerformanceEntry has correct network transfer attributes (xmlhttprequest)]
-    expected: FAIL
-
--- a/testing/web-platform/tests/resource-timing/resources/gzip_xml.py
+++ b/testing/web-platform/tests/resource-timing/resources/gzip_xml.py
@@ -1,13 +1,16 @@
 import gzip as gzip_module
 from cStringIO import StringIO
+import os
 
 def main(request, response):
-    f = open('resource-timing/resources/resource_timing_test0.xml', 'r')
+    dir_path = os.path.dirname(os.path.realpath(__file__))
+    file_path = os.path.join(dir_path, 'resource_timing_test0.xml')
+    f = open(file_path, 'r')
     output = f.read()
 
     out = StringIO()
     with gzip_module.GzipFile(fileobj=out, mode="w") as f:
       f.write(output)
     output = out.getvalue()
 
     headers = [("Content-type", "text/plain"),