Skip to content

Commit 167a2e8

Browse files
committed
[java] Improving docs for CDP generation in Java
[skip ci]
1 parent d0f70cc commit 167a2e8

File tree

2 files changed

+54
-30
lines changed

2 files changed

+54
-30
lines changed

common/devtools/README.md

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,41 @@
11
# Chrome Debugging Protocol
22

3-
We keep multiple versions of the protocol in the tree in order to allow
4-
us to generate bindings as needed.
5-
6-
They are typically downloaded from the [devtools
7-
source](https://github.com/ChromeDevTools/devtools-protocol/tree/master/json)
8-
9-
Fortunately both Chrome and Edge are based off Chromium releases and those
10-
are OSS. In order to get the versions of the protocol spoken by particular
11-
releases of Chrome:
12-
13-
* Find out the latest version of [Stable Channel Update for Desktop](https://chromereleases.googleblog.com/search/label/Stable%20updates)
14-
(e.g., `84.0.4147.125`).
15-
* Navigate to the [Chromium source](https://github.com/chromium/chromium/)
16-
* Open the tag matching the release number.
17-
* Grab `//third_party/blink/public/devtools_protocol/browser_protocol.pdl`
18-
(Quick link: `https://raw.githubusercontent.com/chromium/chromium/<LATEST_VERSION_NUMBER>/third_party/blink/public/devtools_protocol/browser_protocol.pdl`)
19-
* Now figure out the version of v8 used by the version of Chromium. In
20-
Chromium's source, navigate to `//:DEPS` and search for `v8_revision`
21-
(Quick link: `https://github.com/chromium/chromium/blob/<LATEST_VERSION_NUMBER>/DEPS#:~:text=the%20commit%20queue%20can%20handle%20cls%20rolling%20v8`)
22-
* Head over to the [v8 source](https://github.com/v8/v8) and switch to
23-
the indicated revision (e.g., `451d38b60be0a0f692b11815289cf8cbc9b1dc98`)
24-
* Grab `//include:js_protocol.pdl`
25-
(Quick link: `https://github.com/v8/v8/raw/<V8_REVISION_NUMBER>/include/js_protocol.pdl`)
26-
27-
You may also find the same information at the [OmahaProxy CSV
28-
Viewer](https://omahaproxy.appspot.com)
29-
30-
We have a modified form of the scripts used by Chromium to generate the
31-
protocol files. The originals were in:
32-
3+
We keep multiple versions of the protocol in the tree in order to allow us to generate bindings as
4+
needed.
5+
6+
They are typically downloaded from the [devtools source][]
7+
8+
Fortunately both Chrome and Edge are based off Chromium releases and those are OSS. In order to get
9+
the versions of the protocol spoken by particular releases of Chrome:
10+
11+
* Find out the latest version of [Stable Channel Update for Desktop][] (e.g., `96.0.4664.45`).
12+
* Create a `vXX` directory under `//common/devtools/chromium` (e.g. `v96` for `96.0.4664.45`)
13+
* Copy the `BUILD.bazel` file from the `vXX-1` directory.
14+
* Navigate to the [Chromium source][] and open the tag matching the release number.
15+
* Find `//third_party/blink/public/devtools_protocol/browser_protocol.pdl` and download the file
16+
to `//common/devtools/chromium/vXX`.
17+
* (Quick link:
18+
`https://raw.githubusercontent.com/chromium/chromium/<LATEST_VERSION_NUMBER>/third_party/blink/public/devtools_protocol/browser_protocol.pdl`)
19+
* Now figure out the version of v8 used by the version of Chromium. In Chromium's source, navigate
20+
to `//:DEPS` and search for `v8_revision`
21+
* (Quick
22+
link: `https://github.com/chromium/chromium/blob/<LATEST_VERSION_NUMBER>/DEPS#:~:text=the%20commit%20queue%20can%20handle%20cls%20rolling%20v8`)
23+
* Head over to the [v8 source](https://github.com/v8/v8) and switch to the indicated revision
24+
* (e.g., `451d38b60be0a0f692b11815289cf8cbc9b1dc98`)
25+
* Find `//include/js_protocol.pdl` and download the file to `//common/devtools/chromium/vXX`.
26+
(Quick link: `https://github.com/v8/v8/raw/<V8_REVISION_NUMBER>/include/js_protocol.pdl`)
27+
28+
You may also find the same information at the [OmahaProxy CSV Viewer][]
29+
30+
We have a modified form of the scripts used by Chromium to generate the protocol files. The
31+
originals were in:
32+
3333
https://github.com/chromium/chromium/blob/master/third_party/inspector_protocol/convert_protocol_to_json.py
34+
35+
[devtools source]: https://github.com/ChromeDevTools/devtools-protocol/tree/master/json
36+
37+
[Stable Channel Update for Desktop]: https://chromereleases.googleblog.com/search/label/Stable%20updates
38+
39+
[Chromium source]: https://github.com/chromium/chromium/
40+
41+
[OmahaProxy CSV Viewer]: https://omahaproxy.appspot.com
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# CDP Bindings for Java
2+
3+
Before going through these steps, make sure the needed protocol file definitions are in the tree.
4+
Check this [README][] for more information.
5+
6+
They are typically downloaded from the
7+
[devtools source](https://github.com/ChromeDevTools/devtools-protocol/tree/master/json)
8+
9+
* Edit `//java/src/org/openqa/selenium/devtools:versions.bzl` to include the new version number (and
10+
possibly delete the old one, we tend to support only the last 3 versions)
11+
* Copy the most recent `//java/src/org/openqa/selenium/devtools/vXX` to
12+
`//java/src/org/openqa/selenium/devtools/vXX+1`.
13+
* Do a search and replace in that directory, converting `XX` to `XX+1`
14+
* Compile the code 3:38 Fix the places where signatures have changed.
15+
16+
[README]: https://github.com/SeleniumHQ/selenium/tree/trunk/common/devtools

0 commit comments

Comments
 (0)