RE: [Navigation Timing] Proper failure for tests

Thanks for pointing this out Philippe.

We discussed this on today's call and are thinking that #1 is a good simple approach.

We will update the tests (which include the approved tests) soon.

- Nic


-----Original Message-----
From: public-web-perf-request@w3.org [mailto:public-web-perf-request@w3.org] On Behalf Of Philippe Le Hegaret
Sent: Monday, March 28, 2011 7:41 AM
To: public-web-perf
Subject: [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 Wednesday, 30 March 2011 21:53:16 UTC