[presentation-api-tests] [presentation-api] Update tests for onconnect, onclose and onterminate (#5794)

This PR upgrades #4330 and fixes #4040 as well as several additional issues.

* `async_test` and `step_func` are replaced with `promise_test` and `EventWatcher`.
* Each file name is corrected and `.https` is added to the file name.
* The `onclose` and `onterminate` tests check behavior in each connection state: `connecting`, `connected`, `closed` and `terminated`.
* The `onterminate` test also checks behavior of another presentation connection in a nested browsing context.
* The `onterminate` test now supposes that calling `connection.terminate()` must set state of presentation connections in `connecting` and `connected` state to `terminated` as defined in the current spec: https://github.com/w3c/presentation-api/pull/427

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

Received on Friday, 5 May 2017 08:30:21 UTC