From 6785b2feb636a8fe15412ee0cc83517a9a8d5e25 Mon Sep 17 00:00:00 2001 From: Valentin Gosu Date: Thu, 2 Feb 2017 01:25:48 +0100 Subject: [PATCH] Bug 1321878 - Disable diagnostic assert and make test less racy r=me MozReview-Commit-ID: LKiseNvd7t2 --- netwerk/protocol/http/HttpChannelChild.cpp | 12 ++++++------ .../performance-timeline.https.html | 16 +++++----------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/netwerk/protocol/http/HttpChannelChild.cpp b/netwerk/protocol/http/HttpChannelChild.cpp index c71b9c6ba4ba..8bd996239819 100644 --- a/netwerk/protocol/http/HttpChannelChild.cpp +++ b/netwerk/protocol/http/HttpChannelChild.cpp @@ -905,12 +905,12 @@ HttpChannelChild::OnStopRequest(const nsresult& channelStatus, mTransactionTimings.responseStart = timing.responseStart; mTransactionTimings.responseEnd = timing.responseEnd; - // Do not overwrite or adjust the original mAsyncOpenTime. We must use the - // original child process time in order to account for child side work and IPC - // transit overhead. This depends on TimeStamp being equivalent across - // processes. We work hard to ensure this on modern hardware, but there could - // be some variance on older devices. - MOZ_DIAGNOSTIC_ASSERT(mAsyncOpenTime <= timing.fetchStart); + // Do not overwrite or adjust the original mAsyncOpenTime by timing.fetchStart + // We must use the original child process time in order to account for child + // side work and IPC transit overhead. + // XXX: This depends on TimeStamp being equivalent across processes. + // This is true for modern hardware but for older platforms it is not always + // true. mRedirectStartTimeStamp = timing.redirectStart; mRedirectEndTimeStamp = timing.redirectEnd; diff --git a/testing/web-platform/tests/service-workers/service-worker/performance-timeline.https.html b/testing/web-platform/tests/service-workers/service-worker/performance-timeline.https.html index d2ed677e6d01..b66d4a821861 100644 --- a/testing/web-platform/tests/service-workers/service-worker/performance-timeline.https.html +++ b/testing/web-platform/tests/service-workers/service-worker/performance-timeline.https.html @@ -21,16 +21,10 @@ promise_test(t => { .then(_ => with_iframe(scope)) .then(f => { frame = f; - return Promise.all([ - // This will get effectively an empty service worker FetchEvent - // handler. It should have no additional delay. Note that the - // text() call is necessary to complete the response and have the - // timings show up in the performance entries. - frame.contentWindow.fetch(url).then(r => r && r.text()), - // This will cause the service worker to spin for two seconds - // in its FetchEvent handler. - frame.contentWindow.fetch(slowURL).then(r => r && r.text()) - ]); + return frame.contentWindow.fetch(url).then(r => r && r.text()); + }) + .then(_ => { + return frame.contentWindow.fetch(slowURL).then(r => r && r.text()); }) .then(_ => { function elapsed(u) { @@ -42,7 +36,7 @@ promise_test(t => { // Verify the request slowed by the service worker is indeed measured // to be slower. Note, we compare to smaller delay instead of the exact // delay amount to avoid making the test racy under automation. - assert_true(slowURLTime >= urlTime + 1500, + assert_greater_than(slowURLTime, urlTime + 1000, 'Slow service worker request should measure increased delay.'); frame.remove(); return service_worker_unregister_and_done(t, scope);