Closed Bug 640302 Opened 13 years ago Closed 13 years ago

Date comparisons in various add-on manager tests are fragile, and dependent on locale

Categories

(Toolkit :: Add-ons Manager, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla6

People

(Reporter: graememcc, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

Attached patch Patch v1 (obsolete) — Splinter Review
A minor annoyance, so feel free to WONTFIX, but it makes me mutter when I run into it...

The date comparison tests fail locally for me in en_GB.

Date.parse is implementation-defined for strings not conforming to the ECMAScript date string format. Our implementation attempts to parse such strings as month/day/year or year/month/day, and for a two-digit year as an offset from 1900. Hence in this test in en_GB, the original date of 1 August 2010 gets compared against 8th January 1910, and fails.

It seems to me we want to test that detail-dateUpdated has been set to a date correctly formatted for a particular locale rather than testing it is equivalent to a specific date/time.
Attachment #518155 - Flags: review?(dtownsend)
...actually, I'm hitting this in a couple of other tests too. Morphing to reflect this
Attachment #518155 - Attachment is obsolete: true
Attachment #518155 - Flags: review?(dtownsend)
Attachment #518321 - Flags: review?(dtownsend)
Summary: Date comparisons in browser_details.js test are fragile → Date comparisons in various add-on manager tests are fragile, and dependent on locale
Blocks: 514067
Comment on attachment 518321 [details] [diff] [review]
v2 - catch other cases

Looks good, thanks
Attachment #518321 - Flags: review?(dtownsend) → review+
Blocks: 644044
http://hg.mozilla.org/mozilla-central/rev/b3024d5bfdf7
Status: NEW → RESOLVED
Closed: 13 years ago
OS: Linux → All
Hardware: x86_64 → All
Resolution: --- → FIXED
Target Milestone: --- → mozilla6
Verified fixed by check-in and passing tests.
Status: RESOLVED → VERIFIED
Flags: in-testsuite+
Flags: in-litmus-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: