[Web Timing] Fix flaky test.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Jun 2015 22:53:42 +0000 (22:53 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Jun 2015 22:53:42 +0000 (22:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=145846

Patch by Alex Christensen <achristensen@webkit.org> on 2015-06-10
Reviewed by Alexey Proskuryakov.

The timing data is gathered in ResourceHandle::getConnectionTimingData as
millisecond deltas from the fetch start time, not the navigation start time.
The difference between navigation and fetch start time is usually so small that
it only caused one flaky test, but this should fix that flakiness. This patch
corrects how the millisecond deltas are used.

* page/PerformanceTiming.cpp:
(WebCore::PerformanceTiming::domainLookupStart):
(WebCore::PerformanceTiming::domainLookupEnd):
(WebCore::PerformanceTiming::connectStart):
(WebCore::PerformanceTiming::connectEnd):
(WebCore::PerformanceTiming::secureConnectionStart):
(WebCore::PerformanceTiming::requestStart):
(WebCore::PerformanceTiming::responseStart):
(WebCore::PerformanceTiming::responseEnd):
(WebCore::PerformanceTiming::documentLoadTiming):
(WebCore::PerformanceTiming::resourceLoadTimeRelativeToFetchStart):
(WebCore::PerformanceTiming::monotonicTimeToIntegerMilliseconds):
(WebCore::PerformanceTiming::resourceLoadTimeRelativeToAbsolute): Deleted.
* page/PerformanceTiming.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185434 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/page/PerformanceTiming.cpp
Source/WebCore/page/PerformanceTiming.h

index 295dad7..3140916 100644 (file)
@@ -1,3 +1,31 @@
+2015-06-10  Alex Christensen  <achristensen@webkit.org>
+
+        [Web Timing] Fix flaky test.
+        https://bugs.webkit.org/show_bug.cgi?id=145846
+
+        Reviewed by Alexey Proskuryakov.
+
+        The timing data is gathered in ResourceHandle::getConnectionTimingData as 
+        millisecond deltas from the fetch start time, not the navigation start time.
+        The difference between navigation and fetch start time is usually so small that 
+        it only caused one flaky test, but this should fix that flakiness. This patch 
+        corrects how the millisecond deltas are used.
+
+        * page/PerformanceTiming.cpp:
+        (WebCore::PerformanceTiming::domainLookupStart):
+        (WebCore::PerformanceTiming::domainLookupEnd):
+        (WebCore::PerformanceTiming::connectStart):
+        (WebCore::PerformanceTiming::connectEnd):
+        (WebCore::PerformanceTiming::secureConnectionStart):
+        (WebCore::PerformanceTiming::requestStart):
+        (WebCore::PerformanceTiming::responseStart):
+        (WebCore::PerformanceTiming::responseEnd):
+        (WebCore::PerformanceTiming::documentLoadTiming):
+        (WebCore::PerformanceTiming::resourceLoadTimeRelativeToFetchStart):
+        (WebCore::PerformanceTiming::monotonicTimeToIntegerMilliseconds):
+        (WebCore::PerformanceTiming::resourceLoadTimeRelativeToAbsolute): Deleted.
+        * page/PerformanceTiming.h:
+
 2015-06-10  Beth Dakin  <bdakin@apple.com>
 
         Overriding the overlay scrollbar style on WKView doesn't take effect immediately
index 9199bd1..160fadb 100644 (file)
@@ -135,7 +135,7 @@ unsigned long long PerformanceTiming::domainLookupStart() const
     if (timing.domainLookupStart < 0)
         return fetchStart();
 
-    return resourceLoadTimeRelativeToAbsolute(timing.domainLookupStart);
+    return resourceLoadTimeRelativeToFetchStart(timing.domainLookupStart);
 }
 
 unsigned long long PerformanceTiming::domainLookupEnd() const
@@ -151,7 +151,7 @@ unsigned long long PerformanceTiming::domainLookupEnd() const
     if (timing.domainLookupEnd < 0)
         return domainLookupStart();
 
-    return resourceLoadTimeRelativeToAbsolute(timing.domainLookupEnd);
+    return resourceLoadTimeRelativeToFetchStart(timing.domainLookupEnd);
 }
 
 unsigned long long PerformanceTiming::connectStart() const
@@ -173,7 +173,7 @@ unsigned long long PerformanceTiming::connectStart() const
     if (timing.domainLookupEnd >= 0 && timing.domainLookupEnd > connectStart)
         connectStart = timing.domainLookupEnd;
 
-    return resourceLoadTimeRelativeToAbsolute(connectStart);
+    return resourceLoadTimeRelativeToFetchStart(connectStart);
 }
 
 unsigned long long PerformanceTiming::connectEnd() const
@@ -189,7 +189,7 @@ unsigned long long PerformanceTiming::connectEnd() const
     if (timing.connectEnd < 0)
         return connectStart();
 
-    return resourceLoadTimeRelativeToAbsolute(timing.connectEnd);
+    return resourceLoadTimeRelativeToFetchStart(timing.connectEnd);
 }
 
 unsigned long long PerformanceTiming::secureConnectionStart() const
@@ -203,7 +203,7 @@ unsigned long long PerformanceTiming::secureConnectionStart() const
     if (timing.secureConnectionStart < 0)
         return 0;
 
-    return resourceLoadTimeRelativeToAbsolute(timing.secureConnectionStart);
+    return resourceLoadTimeRelativeToFetchStart(timing.secureConnectionStart);
 }
 
 unsigned long long PerformanceTiming::requestStart() const
@@ -215,7 +215,7 @@ unsigned long long PerformanceTiming::requestStart() const
     const ResourceLoadTiming& timing = loader->response().resourceLoadTiming();
     
     ASSERT(timing.requestStart >= 0);
-    return resourceLoadTimeRelativeToAbsolute(timing.requestStart);
+    return resourceLoadTimeRelativeToFetchStart(timing.requestStart);
 }
 
 unsigned long long PerformanceTiming::responseStart() const
@@ -227,7 +227,7 @@ unsigned long long PerformanceTiming::responseStart() const
     const ResourceLoadTiming& timing = loader->response().resourceLoadTiming();
     
     ASSERT(timing.responseStart >= 0);
-    return resourceLoadTimeRelativeToAbsolute(timing.responseStart);
+    return resourceLoadTimeRelativeToFetchStart(timing.responseStart);
 }
 
 unsigned long long PerformanceTiming::responseEnd() const
@@ -331,10 +331,10 @@ DocumentLoadTiming* PerformanceTiming::documentLoadTiming() const
     return &loader->timing();
 }
 
-unsigned long long PerformanceTiming::resourceLoadTimeRelativeToAbsolute(int relativeMilliseconds) const
+unsigned long long PerformanceTiming::resourceLoadTimeRelativeToFetchStart(int relativeMilliseconds) const
 {
     ASSERT(relativeMilliseconds >= 0);
-    return navigationStart() + relativeMilliseconds;
+    return fetchStart() + relativeMilliseconds;
 }
 
 unsigned long long PerformanceTiming::monotonicTimeToIntegerMilliseconds(double monotonicSeconds) const
index e54188a..99092fe 100644 (file)
@@ -77,7 +77,7 @@ private:
     const DocumentTiming* documentTiming() const;
     DocumentLoader* documentLoader() const;
     DocumentLoadTiming* documentLoadTiming() const;
-    unsigned long long resourceLoadTimeRelativeToAbsolute(int) const;
+    unsigned long long resourceLoadTimeRelativeToFetchStart(int) const;
     unsigned long long monotonicTimeToIntegerMilliseconds(double) const;
 };