ChromeDevTools / devtools-protocol

Chrome DevTools Protocol
https://chromedevtools.github.io/devtools-protocol/
BSD 3-Clause "New" or "Revised" License
1.15k stars 226 forks source link

Is there a cross-language test-suite for DevTools protocol clients? #218

Closed d4h0 closed 4 years ago

d4h0 commented 4 years ago

Hello,

I'm working on a DevTools protocol client for Rust, and I'm wondering if there is some kind of test-suite that can be used to test clients.

For example, a JSON file with requests and expected responses would be useful.

With that, I could convert the supplied requests into code that uses my library and then check if the response matches.

I use the JSON files from this repo to automatically generate the types needed for the client (and writing tests by hand is therefore not really an option).

If there isn't a cross-language test-suite, is there some other test-suite?

If there is, for example, a test-suite for a JavaScript client, then maybe the following approach would be possible:

  1. create a WebSocket proxy that will be placed between the test-suite and the DevTools protocol server
  2. save received requests and responses
  3. read stdout of the test-suite and try to find out which tests failed/succeed
paulirish commented 4 years ago

I personally don't know of any tests aside from these: https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/web_tests/http/tests/inspector-protocol/

d4h0 commented 4 years ago

@paulirish: Thank you. I will try to extract usable information from these tests.