[infra-tests] Make promise_test return promise of test completing (#5718)

This allows one to attach callback actions to perform after a test is completed. The promise returned is always resolved regardless of whether the test succeeds. This is consistent with the synchronous behavior of `test()` which always proceed to next line regardless of whether the inner function raised exception.

This PR is mainly for #5712 to perform optional async test loading before performing the main test.

View on GitHub: https://github.com/w3c/web-platform-tests/pull/5718

Received on Thursday, 27 April 2017 10:21:53 UTC