Bug 1168376: Show transferred size in request summary instead of decompressed size

https://github.com/MoonchildProductions/moebius/pull/93
- without: DOMContentLoaded and load
This commit is contained in:
janekptacijarabaci 2018-02-28 16:02:31 +01:00 committed by Roy Tam
commit 173d356acd
11 changed files with 177 additions and 70 deletions

View file

@ -44,7 +44,7 @@ add_task(function* () {
yield teardown(monitor);
function testStatus() {
const { count, totalBytes, totalMillis } = getSummary(gStore.getState());
const { count, contentSize, transferredSize, millis } = getSummary(gStore.getState());
let value = $("#requests-menu-network-summary-button").textContent;
info("Current summary: " + value);
@ -57,13 +57,14 @@ add_task(function* () {
return;
}
info("Computed total bytes: " + totalBytes);
info("Computed total millis: " + totalMillis);
info("Computed total bytes: " + contentSize);
info("Computed total millis: " + millis);
is(value, PluralForm.get(count, L10N.getStr("networkMenu.summary"))
is(value, PluralForm.get(count, L10N.getStr("networkMenu.summary2"))
.replace("#1", count)
.replace("#2", L10N.numberWithDecimals((totalBytes || 0) / 1024, 2))
.replace("#3", L10N.numberWithDecimals((totalMillis || 0) / 1000, 2))
.replace("#2", L10N.numberWithDecimals((contentSize || 0) / 1024, 2))
.replace("#3", L10N.numberWithDecimals((transferredSize || 0) / 1024, 2))
.replace("#4", L10N.numberWithDecimals((millis || 0) / 1000, 2))
, "The current summary text is incorrect.");
}
});