Several Netmonitor tests fail when ECMAScript Internationalization API is enabled

RESOLVED FIXED in Firefox 23

Status

()

Firefox
Developer Tools: Netmonitor
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: Norbert Lindenberg, Assigned: Norbert Lindenberg)

Tracking

Trunk
Firefox 23
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
With the ECMAScript Internationalization API enabled (bug 853301), several Netmonitor tests fail:
https://tbpl.mozilla.org/?tree=Try&rev=8c4fe7a8f11a

09:38:54 WARNING - TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/devtools/netmonitor/test/browser_net_json-long.js | The displayed size is incorrect. - Got 83.96 KB, expected 83.95 KB
09:38:54 WARNING - TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/devtools/netmonitor/test/browser_net_json-long.js | The tooltip size is incorrect. - Got 83.96 KB, expected 83.95 KB
09:39:14 WARNING - TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/devtools/netmonitor/test/browser_net_simple-request-details.js | The response headers scope doesn't have the correct title. - Got Response headers (0.169 KB), expected Response headers (0.168 KB)
(Assignee)

Comment 1

4 years ago
Based on the corresponding successful m-c build
https://tbpl.mozilla.org/php/getParsedLog.php?id=22087893&tree=Mozilla-Central&full=1
the actual unformatted number in browser_net_json-long.js is 85975 bytes, or 83.9599609375 KB.

Netmonitor uses ViewHelpers.L10N.numberWithDecimals to format the KB value to 2 digits. numberWithDecimals in turn calls toLocaleString to localize that number. The old version of toLocaleString returns an unlimited number of digits, in this case ten fraction digits, which numberWithDecimals truncates to two decimals, resulting in 83.95. The new version of toLocaleString by default rounds to three fraction digits, here 83.960, which numberWithDecimals truncates to 83.96.

I couldn't find the number of bytes for browser_net_simple-request-details.js, but I assume it's the same story.
(Assignee)

Comment 2

4 years ago
Created attachment 740590 [details] [diff] [review]
Fix

Try run:
https://tbpl.mozilla.org/?tree=Try&rev=a591f91ecf04
Attachment #740590 - Flags: review?(vporof)
Comment on attachment 740590 [details] [diff] [review]
Fix

Review of attachment 740590 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks!
Attachment #740590 - Flags: review?(vporof) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/118b45dac29f
https://hg.mozilla.org/mozilla-central/rev/118b45dac29f
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 23
You need to log in before you can comment on or make changes to this bug.