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 325412 b3b5af78a162b11a9a838087c0f6ad3567eeb55e
parent 325411 3ea1f28bd0f3b021b40693d6a3a6f944a9e82420
child 325413 c6face1d7183eea175fd7b00e576d3312f3fd14c
push id31054
push usercbook@mozilla.com
push dateFri, 09 Dec 2016 12:32:25 +0000
treeherdermozilla-central@44ab7f53ead5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku, jgraham
bugs919391
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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"),