mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 874040 - Fix l10n expectations in net monitor tests, r=vp
This commit is contained in:
parent
f07fb93b34
commit
fa222527bc
@ -21,7 +21,7 @@ function test() {
|
||||
statusText: "OK",
|
||||
type: "xml",
|
||||
fullMimeType: "text/xml; charset=utf-8",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.04),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0.04),
|
||||
time: true
|
||||
});
|
||||
verifyRequestItemTarget(RequestsMenu.getItemAtIndex(1),
|
||||
@ -30,7 +30,7 @@ function test() {
|
||||
statusText: "OK",
|
||||
type: "css",
|
||||
fullMimeType: "text/css; charset=utf-8",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.03),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0.03),
|
||||
time: true
|
||||
});
|
||||
verifyRequestItemTarget(RequestsMenu.getItemAtIndex(2),
|
||||
@ -39,7 +39,7 @@ function test() {
|
||||
statusText: "OK",
|
||||
type: "js",
|
||||
fullMimeType: "application/javascript; charset=utf-8",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.03),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0.03),
|
||||
time: true
|
||||
});
|
||||
verifyRequestItemTarget(RequestsMenu.getItemAtIndex(3),
|
||||
@ -48,7 +48,7 @@ function test() {
|
||||
statusText: "OK",
|
||||
type: "json",
|
||||
fullMimeType: "application/json; charset=utf-8",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.02),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0.02),
|
||||
time: true
|
||||
});
|
||||
verifyRequestItemTarget(RequestsMenu.getItemAtIndex(4),
|
||||
@ -57,7 +57,7 @@ function test() {
|
||||
statusText: "Not Found",
|
||||
type: "html",
|
||||
fullMimeType: "text/html; charset=utf-8",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.02),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0.02),
|
||||
time: true
|
||||
});
|
||||
verifyRequestItemTarget(RequestsMenu.getItemAtIndex(5),
|
||||
@ -66,7 +66,7 @@ function test() {
|
||||
statusText: "OK",
|
||||
type: "png",
|
||||
fullMimeType: "image/png",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.75),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0.75),
|
||||
time: true
|
||||
});
|
||||
|
||||
|
@ -21,7 +21,7 @@ function test() {
|
||||
statusText: "OK",
|
||||
type: "json",
|
||||
fullMimeType: "text/json; charset=utf-8",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.04),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0.04),
|
||||
time: true
|
||||
});
|
||||
|
||||
|
@ -22,7 +22,7 @@ function test() {
|
||||
statusText: "Och Aye",
|
||||
type: "plain",
|
||||
fullMimeType: "text/plain; charset=utf-8",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.01),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0.01),
|
||||
time: true
|
||||
});
|
||||
verifyRequestItemTarget(RequestsMenu.getItemAtIndex(1),
|
||||
@ -31,7 +31,7 @@ function test() {
|
||||
statusText: "Och Aye",
|
||||
type: "plain",
|
||||
fullMimeType: "text/plain; charset=utf-8",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.01),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0.01),
|
||||
time: true
|
||||
});
|
||||
|
||||
|
@ -166,7 +166,7 @@ function test() {
|
||||
verifyRequestItemTarget(requestItem, "GET", SIMPLE_SJS, {
|
||||
type: "plain",
|
||||
fullMimeType: "text/plain; charset=utf-8",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.01),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0.01),
|
||||
});
|
||||
});
|
||||
|
||||
@ -185,7 +185,7 @@ function test() {
|
||||
verifyRequestItemTarget(requestItem, "GET", SIMPLE_SJS, {
|
||||
type: "plain",
|
||||
fullMimeType: "text/plain; charset=utf-8",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.01),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0.01),
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -176,7 +176,7 @@ function test() {
|
||||
statusText: "Switching Protocols",
|
||||
type: "plain",
|
||||
fullMimeType: "text/plain; charset=utf-8",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0),
|
||||
time: true
|
||||
});
|
||||
verifyRequestItemTarget(RequestsMenu.getItemAtIndex(b),
|
||||
@ -185,7 +185,7 @@ function test() {
|
||||
statusText: "Created",
|
||||
type: "plain",
|
||||
fullMimeType: "text/plain; charset=utf-8",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.02),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0.02),
|
||||
time: true
|
||||
});
|
||||
verifyRequestItemTarget(RequestsMenu.getItemAtIndex(c),
|
||||
@ -194,7 +194,7 @@ function test() {
|
||||
statusText: "See Other",
|
||||
type: "plain",
|
||||
fullMimeType: "text/plain; charset=utf-8",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0),
|
||||
time: true
|
||||
});
|
||||
verifyRequestItemTarget(RequestsMenu.getItemAtIndex(d),
|
||||
@ -203,7 +203,7 @@ function test() {
|
||||
statusText: "Not Found",
|
||||
type: "plain",
|
||||
fullMimeType: "text/plain; charset=utf-8",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.02),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0.02),
|
||||
time: true
|
||||
});
|
||||
verifyRequestItemTarget(RequestsMenu.getItemAtIndex(e),
|
||||
@ -212,7 +212,7 @@ function test() {
|
||||
statusText: "Not Implemented",
|
||||
type: "plain",
|
||||
fullMimeType: "text/plain; charset=utf-8",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.02),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0.02),
|
||||
time: true
|
||||
});
|
||||
|
||||
|
@ -181,7 +181,7 @@ function test() {
|
||||
statusText: "Meh",
|
||||
type: "1",
|
||||
fullMimeType: "text/1",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0),
|
||||
time: true
|
||||
});
|
||||
verifyRequestItemTarget(RequestsMenu.getItemAtIndex(b),
|
||||
@ -191,7 +191,7 @@ function test() {
|
||||
statusText: "Meh",
|
||||
type: "2",
|
||||
fullMimeType: "text/2",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.01),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0.01),
|
||||
time: true
|
||||
});
|
||||
verifyRequestItemTarget(RequestsMenu.getItemAtIndex(c),
|
||||
@ -201,7 +201,7 @@ function test() {
|
||||
statusText: "Meh",
|
||||
type: "3",
|
||||
fullMimeType: "text/3",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.02),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0.02),
|
||||
time: true
|
||||
});
|
||||
verifyRequestItemTarget(RequestsMenu.getItemAtIndex(d),
|
||||
@ -211,7 +211,7 @@ function test() {
|
||||
statusText: "Meh",
|
||||
type: "4",
|
||||
fullMimeType: "text/4",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.03),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0.03),
|
||||
time: true
|
||||
});
|
||||
verifyRequestItemTarget(RequestsMenu.getItemAtIndex(e),
|
||||
@ -221,7 +221,7 @@ function test() {
|
||||
statusText: "Meh",
|
||||
type: "5",
|
||||
fullMimeType: "text/5",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.04),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0.04),
|
||||
time: true
|
||||
});
|
||||
|
||||
|
@ -118,7 +118,7 @@ function test() {
|
||||
statusText: "Meh",
|
||||
type: "1",
|
||||
fullMimeType: "text/1",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0),
|
||||
time: true
|
||||
});
|
||||
}
|
||||
@ -130,7 +130,7 @@ function test() {
|
||||
statusText: "Meh",
|
||||
type: "2",
|
||||
fullMimeType: "text/2",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.01),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0.01),
|
||||
time: true
|
||||
});
|
||||
}
|
||||
@ -142,7 +142,7 @@ function test() {
|
||||
statusText: "Meh",
|
||||
type: "3",
|
||||
fullMimeType: "text/3",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.02),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0.02),
|
||||
time: true
|
||||
});
|
||||
}
|
||||
@ -154,7 +154,7 @@ function test() {
|
||||
statusText: "Meh",
|
||||
type: "4",
|
||||
fullMimeType: "text/4",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.03),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0.03),
|
||||
time: true
|
||||
});
|
||||
}
|
||||
@ -166,7 +166,7 @@ function test() {
|
||||
statusText: "Meh",
|
||||
type: "5",
|
||||
fullMimeType: "text/5",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.04),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0.04),
|
||||
time: true
|
||||
});
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ function test() {
|
||||
statusText: "Switching Protocols",
|
||||
type: "plain",
|
||||
fullMimeType: "text/plain; charset=utf-8",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0),
|
||||
time: true
|
||||
});
|
||||
verifyRequestItemTarget(requestItems[1] = RequestsMenu.getItemAtIndex(1),
|
||||
@ -33,7 +33,7 @@ function test() {
|
||||
statusText: "Created",
|
||||
type: "plain",
|
||||
fullMimeType: "text/plain; charset=utf-8",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.02),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0.02),
|
||||
time: true
|
||||
});
|
||||
verifyRequestItemTarget(requestItems[2] = RequestsMenu.getItemAtIndex(2),
|
||||
@ -42,7 +42,7 @@ function test() {
|
||||
statusText: "See Other",
|
||||
type: "plain",
|
||||
fullMimeType: "text/plain; charset=utf-8",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0),
|
||||
time: true
|
||||
});
|
||||
verifyRequestItemTarget(requestItems[3] = RequestsMenu.getItemAtIndex(3),
|
||||
@ -51,7 +51,7 @@ function test() {
|
||||
statusText: "Not Found",
|
||||
type: "plain",
|
||||
fullMimeType: "text/plain; charset=utf-8",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.02),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0.02),
|
||||
time: true
|
||||
});
|
||||
verifyRequestItemTarget(requestItems[4] = RequestsMenu.getItemAtIndex(4),
|
||||
@ -60,7 +60,7 @@ function test() {
|
||||
statusText: "Not Implemented",
|
||||
type: "plain",
|
||||
fullMimeType: "text/plain; charset=utf-8",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.02),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0.02),
|
||||
time: true
|
||||
});
|
||||
|
||||
|
@ -203,6 +203,20 @@ ViewHelpers.L10N.prototype = {
|
||||
return this.stringBundle.formatStringFromName(aName, aArgs, aArgs.length);
|
||||
},
|
||||
|
||||
/**
|
||||
* L10N shortcut function for numeric arguments that need to be formatted.
|
||||
* All numeric arguments will be fixed to 2 decimals and given a localized
|
||||
* decimal separator. Other arguments will be left alone.
|
||||
* @param string aName
|
||||
* @param array aArgs
|
||||
* @return string
|
||||
*/
|
||||
getFormatStrWithNumbers: function(aName, ...aArgs) {
|
||||
let newArgs = aArgs.map(x => (typeof x == 'number' ?
|
||||
this.numberWithDecimals(x, 2) : x));
|
||||
return this.stringBundle.formatStringFromName(aName, newArgs, newArgs.length);
|
||||
},
|
||||
|
||||
/**
|
||||
* Converts a number to a locale-aware string format and keeps a certain
|
||||
* number of decimals.
|
||||
|
Loading…
Reference in New Issue
Block a user