Ticket #3461 (closed task: fixed)

Opened 22 months ago

Last modified 21 months ago

BaseTypes/Date.html tests fail in FF

Reported by: erilem Owned by:
Priority: major Milestone: 2.11 Release
Component: tests Version: 2.11 RC2
Keywords: Cc: mprins
State: Pullup

Description

BaseTypes/Date.html: fail 1 ok 1 (detailed: fail 0 ok 95)
test_Date_toISOString planned 3 assertions but got 2; fail 0 ok 2
exception: : object: invalid date
in ( [object Date]) at http://localhost/~elemoine/openlayers/openlayers/lib/OpenLayers/BaseTypes/Date.js line 37
in test_Date_toISOString( [object Object]) at http://localhost/~elemoine/openlayers/openlayers/tests/BaseTypes/Date.html line 23
in ( ) at http://localhost/~elemoine/openlayers/openlayers/tests/run-tests.html line 985
in ( ) at http://localhost/~elemoine/openlayers/openlayers/tests/run-tests.html line 943
in onload( [object Event]) at http://localhost/~elemoine/openlayers/openlayers/tests/run-tests.html line 1
ok valid date
ok zero padding

Change History

Changed 22 months ago by mprins

  • cc mprins added

FF6 had a bugfix so it now returns a RangeError (previously it returned a String "Invalid Date"). The expected value should be instanceof RangeError for FF6. something like:

        // check invalid date
        date = new Date("foo");
        try {
            var d = OpenLayers.Date.toISOString(date);
        } catch (ex) {
            t.ok(ex instanceof RangeError, "invalid date");
        }
        t.eq(undefined, d, "invalid date");

This will ofcourse break some other browsers.

see:  https://bugzilla.mozilla.org/show_bug.cgi?id=649575 note: there's a useful link to the MSDN IE test pages in there as well.

Changed 22 months ago by tschaub

  • status changed from new to closed
  • resolution set to fixed

(In [12254]) Updating the date tests to work against Firefox 6 (and any other implementations that throw RangeError). closes #3461

Changed 22 months ago by tschaub

  • status changed from closed to reopened
  • state set to Pullup
  • resolution fixed deleted

Changed 22 months ago by tschaub

With my copy of Firefox 6, I get the following:

    >>> new Date('foo')
    Date {Invalid Date}

So I was never really able to reproduce the test failure. r12254 should guard against browsers that do throw a RangeError. Let me know if this doesn't fix the test failures for you.

Changed 21 months ago by crschmidt

  • status changed from reopened to closed
  • resolution set to fixed

(In [12274]) Pulling in patches for OL 2.11 RC3:

  • ArcGISCache resolutions get compromised by some JS frameworks. (Closes #3474)
  • OpenLayers.Layer.HTTPRequest initialize simplification (Closes #3470)
  • missing requires (Closes #3467)
  • deleting a vertex does not update feature.modified (Closes #3463)
  • fixing test failure in some browsers (Closes #3461)
  • a grid layer may be moved while its grid hasn't been initialized yet (Closes #3458) -- this one is the actual release blocker
  • Change the callback function of Protocol.Script (JSONP) (Closes #3417)
  • "build.py -c closure" does not work on Windows systems. (Closes #3158)
Note: See TracTickets for help on using tickets.