[Navigation Timing] Proper failure for tests

I noticed that some of our tests don't fail gracefully when running on
"non-perf" browsers.

For example, [1] reports "Found 0 tests" on firefox or opera. There are
two approaches to fix that:

1. we could test if window.performance and window.performance.timing
exist, report failure if they don't, and abandon that. This has the
disadvantage of not knowing how many tests are included with the file
and the test still takes a long time to fail.

2. for each test within the file, we could add an assertion that
window.performance and window.performance.timing exist. It requires more
work to rewrite some of the tests and is more representative of the
tests and it fails quicker (no more exception preventing done() from
being called).


I attached examples for each solution. Try them on a "non-perf" browser.

Philippe


[1]
http://w3c-test.org/webperf/tests/approved/test_navigate_within_document.htm

Received on Monday, 28 March 2011 14:41:05 UTC