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

VERIFIED FIXED in mozilla6

Status

()

Toolkit
Add-ons Manager
VERIFIED FIXED
6 years ago
6 years ago

People

(Reporter: graememcc, Unassigned)

Tracking

(Blocks: 2 bugs)

Trunk
mozilla6
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +
in-litmus -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

6 years ago
Created attachment 518155 [details] [diff] [review]
Patch v1

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.
(Reporter)

Updated

6 years ago
Attachment #518155 - Flags: review?(dtownsend)
(Reporter)

Comment 1

6 years ago
Created attachment 518321 [details] [diff] [review]
v2 - catch other cases

...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)
(Reporter)

Updated

6 years ago
Summary: Date comparisons in browser_details.js test are fragile → Date comparisons in various add-on manager tests are fragile, and dependent on locale
(Reporter)

Updated

6 years ago
Blocks: 514067
Comment on attachment 518321 [details] [diff] [review]
v2 - catch other cases

Looks good, thanks
Attachment #518321 - Flags: review?(dtownsend) → review+
Blocks: 644044
(Reporter)

Comment 3

6 years ago
http://hg.mozilla.org/mozilla-central/rev/b3024d5bfdf7
Status: NEW → RESOLVED
Last Resolved: 6 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.