[web-platform-tests] Pull Request: Close peer connection and tracks after end of each test

wpt-pr-bot has just labeled a pull request from soareschen for https://github.com/w3c/web-platform-tests as "wg-webrtc":

== Close peer connection and tracks after end of each test ==
Fixes #8301.

This PR introduce add hoc clean up of peer connections and tracks using `t.add_cleanup()` in each test. This approach is use so that we can have minimal disruption to existing tests and make the changes more easily reviewable.

An alternative approach along the line of using a helper function like `makePeerConnection(t)` has been attempted before. But I discovered it is much harder to verify whether the refactoring has been done correctly or not.

This PR affects almost all tests in /webrtc, but it should _not_ affect the results of existing tests. I have tried to make sure that the test results remain the same as before, but there might be lurking mistakes
not yet executed by failing tests.

Some of the async tests require careful refactoring, in particular test of signaling state changes as closing pc too early may produce wrong assertion during event callback.

It may not be worthwhile to merge the whole PR if we find this too difficult or too large to review. If that is the case we may consider to only add the cleanup to the most resource intensive tests, and then gradually introduce cleanup to other small tests at a later time.

See https://github.com/w3c/web-platform-tests/pull/8542

Received on Saturday, 2 December 2017 05:51:36 UTC