Last Comment Bug 864519 - Several Netmonitor tests fail when ECMAScript Internationalization API is enabled
: Several Netmonitor tests fail when ECMAScript Internationalization API is ena...
Status: RESOLVED FIXED
:
Product: Firefox
Classification: Client Software
Component: Developer Tools: Netmonitor (show other bugs)
: Trunk
: All All
: -- normal (vote)
: Firefox 23
Assigned To: Norbert Lindenberg
:
: Jan Honza Odvarko [:Honza]
Mentors:
Depends on:
Blocks: 853301
  Show dependency treegraph
 
Reported: 2013-04-22 14:50 PDT by Norbert Lindenberg
Modified: 2013-04-23 12:10 PDT (History)
2 users (show)
ryanvm: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Fix (2.66 KB, patch)
2013-04-22 18:38 PDT, Norbert Lindenberg
vporof: review+
Details | Diff | Splinter Review

Description User image Norbert Lindenberg 2013-04-22 14:50:29 PDT
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)
Comment 1 User image Norbert Lindenberg 2013-04-22 15:21:50 PDT
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.
Comment 2 User image Norbert Lindenberg 2013-04-22 18:38:17 PDT
Created attachment 740590 [details] [diff] [review]
Fix

Try run:
https://tbpl.mozilla.org/?tree=Try&rev=a591f91ecf04
Comment 3 User image Victor Porof [:vporof][:vp] 2013-04-23 00:52:51 PDT
Comment on attachment 740590 [details] [diff] [review]
Fix

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

Thanks!
Comment 4 User image Victor Porof [:vporof][:vp] 2013-04-23 05:06:44 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/118b45dac29f
Comment 5 User image Ryan VanderMeulen [:RyanVM] 2013-04-23 12:10:37 PDT
https://hg.mozilla.org/mozilla-central/rev/118b45dac29f

Note You need to log in before you can comment on or make changes to this bug.