[web-platform-tests] Pull Request: Add centralized IDL test for WebRTC

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

== Add centralized IDL test for WebRTC ==
This is a follow up on #5693. The code follows the convention of #5666 to have all WebRTC IDL tests in one place.

- The IDL definition is extracted from https://w3c.github.io/webrtc-pc/ and put at `/interfaces/webrtc.idl`.
- All IDL tests for WebRTC is done at `/webrtc/interfaces.html`.
- Currently only IDL tests for section 4 is implemented.

There are a few issues I encountered when writing the tests, which I will report in separate issue:

- The IDL definition for `partial dictionary RTCOfferOptions` is not recognized by idlharness. I had to manually merge the definition to make the parsing successful.

- Some IDL such as `RTCPeerConnectionIceErrorEvent` are yet to be implemented by browsers. In these cases the error occur during construction.

- Unlike the DOM IDL test, some IDL instance such as `RTCCertificate` can only be constructed asynchronously.

- `promise_test()` does not return a promise. This makes it hard to express things like "Do X after the promise test is done".

Right now I do all IDL tests in the same `interfaces.html`. To deal with undefined IDLs and async initialization, I added some non trivial code which adds complexity. An alternative approach is to use the old way of writing the tests in separate HTML files, so that failure of one test does not affect others. Suggestions are welcome on better ways to write the test.

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

Received on Thursday, 27 April 2017 04:48:57 UTC