Re: [presentation-api-tests] Add `step_timeout` in PresentationConnection_onxxx (#4319)

> I thought 2 sec would be enough.

Right. 2s might be enough, but 5s is the default timeout of the test harness so we should stick to it unless there's a good reason to depart. In an ideal world, we would not need to hardcode this number in tests but would rather have a method to tell the harness to just restart the timeout using whatever duration it uses by default. That method does not exist though.

> Can you explain why we need to call force_timeout before done?

Well, `step_timeout` merely sets a timeout in the JS sense of that world, it does not tell the test harness to consider that the test times out after some duration.

In other words, If you just call `done`, all you're telling the test harness is "look, I'm done with this test". Since no expectation failed, the test harness will happily report a `PASS` outcome. The call to `force_timeout` tells the test harness "look, you should consider that this test timed out". The test harness will then report a `TIMEOUT` outcome.

View on GitHub: https://github.com/w3c/web-platform-tests/pull/4319#issuecomment-266789176

Received on Tuesday, 13 December 2016 16:37:24 UTC