зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1321878 - Disable diagnostic assert and make test less racy r=me
MozReview-Commit-ID: LKiseNvd7t2
This commit is contained in:
Родитель
a0b6f6769a
Коммит
6785b2feb6
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче