Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 1 | # WebDriver BiDi for Chromium [](https://www.npmjs.com/package/chromium-bidi) |
| 2 | |
Randolf | 5543146 | 2023-03-29 13:00:36 | [diff] [blame] | 3 | ## CI status |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 4 | |
Randolf | 5543146 | 2023-03-29 13:00:36 | [diff] [blame] | 5 |  |
| 6 |  |
Randolf Jung | bcb3bc8 | 2023-06-26 16:30:14 | [diff] [blame] | 7 |  |
Randolf | 5543146 | 2023-03-29 13:00:36 | [diff] [blame] | 8 | |
Randolf | 5543146 | 2023-03-29 13:00:36 | [diff] [blame] | 9 |  |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 10 | |
Randolf Jung | 3e52631 | 2023-08-08 06:20:39 | [diff] [blame] | 11 | [](https://codecov.io/gh/GoogleChromeLabs/chromium-bidi) |
| 12 | |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 13 | This is an implementation of the |
| 14 | [WebDriver BiDi](https://w3c.github.io/webdriver-bidi/) protocol with some |
| 15 | extensions (**BiDi+**) |
| 16 | for Chromium, implemented as a JavaScript layer translating between BiDi and CDP, |
| 17 | running inside a Chrome tab. |
| 18 | |
| 19 | Current status can be checked |
| 20 | at [WPT WebDriver BiDi status](https://wpt.fyi/results/webdriver/tests/bidi). |
| 21 | |
| 22 | ## BiDi+ |
| 23 | |
| 24 | **"BiDi+"** is an extension of the WebDriver BiDi protocol. In addition to [WebDriver BiDi](https://w3c.github.io/webdriver-bidi/) it has: |
| 25 | |
| 26 | ### Command `cdp.sendCommand` |
| 27 | |
| 28 | ```cddl |
| 29 | CdpSendCommandCommand = { |
| 30 | method: "cdp.sendCommand", |
| 31 | params: ScriptEvaluateParameters, |
| 32 | } |
| 33 | |
| 34 | CdpSendCommandParameters = { |
Alex Rudenko | 1552f2b | 2023-07-11 11:18:32 | [diff] [blame] | 35 | method: text, |
| 36 | params: any, |
| 37 | session?: text, |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 38 | } |
| 39 | |
| 40 | CdpSendCommandResult = { |
| 41 | result: any, |
Alex Rudenko | 1552f2b | 2023-07-11 11:18:32 | [diff] [blame] | 42 | session: text, |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 43 | } |
| 44 | ``` |
| 45 | |
| 46 | The command runs the |
| 47 | described [CDP command](https://chromedevtools.github.io/devtools-protocol) |
Alex Rudenko | 1552f2b | 2023-07-11 11:18:32 | [diff] [blame] | 48 | and returns the result. |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 49 | |
| 50 | ### Command `cdp.getSession` |
| 51 | |
| 52 | ```cddl |
| 53 | CdpGetSessionCommand = { |
| 54 | method: "cdp.sendCommand", |
| 55 | params: ScriptEvaluateParameters, |
| 56 | } |
| 57 | |
| 58 | CdpGetSessionParameters = { |
| 59 | context: BrowsingContext, |
| 60 | } |
| 61 | |
| 62 | CdpGetSessionResult = { |
Alex Rudenko | 1552f2b | 2023-07-11 11:18:32 | [diff] [blame] | 63 | session: text, |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 64 | } |
| 65 | ``` |
| 66 | |
| 67 | The command returns the default CDP session for the selected browsing context. |
| 68 | |
Alex Rudenko | 1552f2b | 2023-07-11 11:18:32 | [diff] [blame] | 69 | ### Events `cdp` |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 70 | |
| 71 | ```cddl |
| 72 | CdpEventReceivedEvent = { |
Alex Rudenko | 1552f2b | 2023-07-11 11:18:32 | [diff] [blame] | 73 | method: "cdp.<CDP Event Name>", |
| 74 | params: CdpEventReceivedParameters, |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 75 | } |
| 76 | |
| 77 | CdpEventReceivedParameters = { |
Alex Rudenko | 1552f2b | 2023-07-11 11:18:32 | [diff] [blame] | 78 | event: text, |
| 79 | params: any, |
| 80 | session: text, |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 81 | } |
| 82 | ``` |
| 83 | |
| 84 | The event contains a CDP event. |
| 85 | |
| 86 | ### Field `channel` |
| 87 | |
| 88 | Each command can be extended with a `channel`: |
| 89 | |
| 90 | ```cddl |
| 91 | Command = { |
| 92 | id: js-uint, |
| 93 | channel?: text, |
| 94 | CommandData, |
| 95 | Extensible, |
| 96 | } |
| 97 | ``` |
| 98 | |
| 99 | If provided and non-empty string, the very same `channel` is added to the response: |
| 100 | |
| 101 | ```cddl |
| 102 | CommandResponse = { |
| 103 | id: js-uint, |
| 104 | channel?: text, |
| 105 | result: ResultData, |
| 106 | Extensible, |
| 107 | } |
| 108 | |
| 109 | ErrorResponse = { |
| 110 | id: js-uint / null, |
| 111 | channel?: text, |
| 112 | error: ErrorCode, |
| 113 | message: text, |
| 114 | ?stacktrace: text, |
| 115 | Extensible |
| 116 | } |
| 117 | ``` |
| 118 | |
| 119 | When client uses |
| 120 | commands [`session.subscribe`](https://w3c.github.io/webdriver-bidi/#command-session-subscribe) |
| 121 | and [`session.unsubscribe`](https://w3c.github.io/webdriver-bidi/#command-session-unsubscribe) |
| 122 | with `channel`, the subscriptions are handled per channel, and the corresponding |
| 123 | `channel` filed is added to the event message: |
| 124 | |
| 125 | ```cddl |
| 126 | Event = { |
| 127 | channel?: text, |
| 128 | EventData, |
| 129 | Extensible, |
| 130 | } |
| 131 | ``` |
| 132 | |
| 133 | ## Dev Setup |
| 134 | |
| 135 | ### `npm` |
| 136 | |
| 137 | This is a Node.js project, so install dependencies as usual: |
| 138 | |
| 139 | ```sh |
| 140 | npm install |
| 141 | ``` |
| 142 | |
Randolf Jung | 3e52631 | 2023-08-08 06:20:39 | [diff] [blame] | 143 | ### `cargo` |
| 144 | |
| 145 | <!-- TODO(jrandolf): Remove after binaries get published --> |
| 146 | |
Alex Rudenko | 662ce9c | 2023-08-29 08:05:30 | [diff] [blame] | 147 | We use [cddlconv](https://github.com/google/cddlconv) to generate our WebDriverBidi types before building. |
Randolf Jung | 3e52631 | 2023-08-08 06:20:39 | [diff] [blame] | 148 | |
| 149 | 1. Install [Rust](https://rustup.rs/). |
Alex Rudenko | 662ce9c | 2023-08-29 08:05:30 | [diff] [blame] | 150 | 2. Run `cargo install --git https://github.com/google/cddlconv.git cddlconv` |
Randolf Jung | 3e52631 | 2023-08-08 06:20:39 | [diff] [blame] | 151 | |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 152 | ### pre-commit.com integration |
| 153 | |
| 154 | Refer to the documentation at [.pre-commit-config.yaml](.pre-commit-config.yaml). |
| 155 | |
Alex Rudenko | f7ea7ab | 2023-10-24 09:40:51 | [diff] [blame^] | 156 | ```sh |
| 157 | pre-commit install --hook-type pre-push |
| 158 | ``` |
| 159 | |
| 160 | ### Starting WebDriver BiDi Server |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 161 | |
| 162 | This will run the server on port `8080`: |
| 163 | |
| 164 | ```sh |
| 165 | npm run server |
| 166 | ``` |
| 167 | |
| 168 | Use the `PORT=` environment variable or `--port=` argument to run it on another port: |
| 169 | |
| 170 | ```sh |
| 171 | PORT=8081 npm run server |
| 172 | npm run server -- --port=8081 |
| 173 | ``` |
| 174 | |
| 175 | Use the `DEBUG` environment variable to see debug info: |
| 176 | |
| 177 | ```sh |
| 178 | DEBUG=* npm run server |
| 179 | ``` |
| 180 | |
Alex Rudenko | 5fe99f8 | 2023-10-06 12:01:27 | [diff] [blame] | 181 | Use the `DEBUG_DEPTH` (default: `10`) environment variable to see debug deeply nested objects: |
| 182 | |
| 183 | ```sh |
| 184 | DEBUG_DEPTH=100 DEBUG=* npm run server |
| 185 | ``` |
| 186 | |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 187 | Use the CLI argument `--headless=false` to run browser in headful mode: |
| 188 | |
| 189 | ```sh |
| 190 | npm run server -- --headless=false |
| 191 | ``` |
| 192 | |
| 193 | Use the `CHANNEL=...` environment variable or `--channel=...` argument with one of |
Randolf | 5543146 | 2023-03-29 13:00:36 | [diff] [blame] | 194 | the following values to run the specific Chrome channel: `stable`, |
| 195 | `beta`, `canary`, `dev`. |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 196 | |
| 197 | The requested Chrome version should be installed. |
| 198 | |
| 199 | ```sh |
Randolf | 5543146 | 2023-03-29 13:00:36 | [diff] [blame] | 200 | CHANNEL=dev npm run server |
| 201 | npm run server -- --channel=dev |
| 202 | ``` |
| 203 | |
Alex Rudenko | 1552f2b | 2023-07-11 11:18:32 | [diff] [blame] | 204 | Use the CLI argument `--verbose` to have CDP events printed to the console. Note: you have to enable debugging output `bidi:mapper:debug:*` as well. |
Randolf | 5543146 | 2023-03-29 13:00:36 | [diff] [blame] | 205 | |
| 206 | ```sh |
Alex Rudenko | 1552f2b | 2023-07-11 11:18:32 | [diff] [blame] | 207 | DEBUG=bidi:mapper:debug:* npm run server -- --verbose |
Randolf | 5543146 | 2023-03-29 13:00:36 | [diff] [blame] | 208 | ``` |
| 209 | |
| 210 | or |
| 211 | |
| 212 | ```sh |
| 213 | DEBUG=* npm run server -- --verbose |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 214 | ``` |
| 215 | |
| 216 | ### Starting on Linux and Mac |
| 217 | |
Randolf Jung | bcb3bc8 | 2023-06-26 16:30:14 | [diff] [blame] | 218 | TODO: verify it works on Windows. |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 219 | |
Randolf Jung | 3e52631 | 2023-08-08 06:20:39 | [diff] [blame] | 220 | You can also run the server by using `npm run server`. It will write |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 221 | output to the file `log.txt`: |
| 222 | |
| 223 | ```sh |
Randolf Jung | 3e52631 | 2023-08-08 06:20:39 | [diff] [blame] | 224 | npm run server -- --port=8081 --headless=false |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 225 | ``` |
| 226 | |
Alex Rudenko | 5fe99f8 | 2023-10-06 12:01:27 | [diff] [blame] | 227 | ### Running with in other project |
| 228 | |
| 229 | Sometimes it good to verify that a change will not affect thing downstream for other packages. |
| 230 | There is a useful `puppeteer` label you can add to any PR to run Puppeteer test with your changes. |
| 231 | It will bundle `chromium-bidi` and install it in Puppeteer project then run that package test. |
| 232 | |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 233 | ## Running |
| 234 | |
| 235 | ### Unit tests |
| 236 | |
| 237 | Running: |
| 238 | |
| 239 | ```sh |
Randolf Jung | bcb3bc8 | 2023-06-26 16:30:14 | [diff] [blame] | 240 | npm run unit |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 241 | ``` |
| 242 | |
| 243 | ### E2E tests |
| 244 | |
| 245 | The E2E tests are written using Python, in order to learn how to eventually do |
| 246 | this in web-platform-tests. |
| 247 | |
Alex Rudenko | 5fe99f8 | 2023-10-06 12:01:27 | [diff] [blame] | 248 | #### Installation |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 249 | |
| 250 | Python 3.6+ and some dependencies are required: |
| 251 | |
| 252 | ```sh |
| 253 | python3 -m pip install --user -r tests/requirements.txt |
| 254 | ``` |
| 255 | |
Alex Rudenko | 5fe99f8 | 2023-10-06 12:01:27 | [diff] [blame] | 256 | #### Running |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 257 | |
| 258 | The E2E tests require BiDi server running on the same host. By default, tests |
| 259 | try to connect to the port `8080`. The server can be run from the project root: |
| 260 | |
| 261 | ```sh |
Randolf Jung | bcb3bc8 | 2023-06-26 16:30:14 | [diff] [blame] | 262 | npm run e2e # alias to to e2e-headless |
| 263 | npm run e2e-headful |
| 264 | npm run e2e-headless |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 265 | ``` |
| 266 | |
| 267 | Use the `PORT` environment variable to connect to another port: |
| 268 | |
| 269 | ```sh |
| 270 | PORT=8081 npm run e2e |
| 271 | ``` |
| 272 | |
Alex Rudenko | f7ea7ab | 2023-10-24 09:40:51 | [diff] [blame^] | 273 | ### Local http server |
| 274 | |
| 275 | E2E tests use local http |
| 276 | server [`pytest-httpserver`](https://pytest-httpserver.readthedocs.io/), which is run |
| 277 | automatically with the tests. However, |
| 278 | sometimes it is useful to run the http server outside the test |
| 279 | case, for example for manual debugging. This can be done by running: |
| 280 | |
| 281 | ```sh |
| 282 | python3 tools/run_local_http_server.py |
| 283 | ``` |
| 284 | |
| 285 | or use npm: |
| 286 | |
| 287 | ```sh |
| 288 | npm run local-http-server |
| 289 | ``` |
| 290 | |
| 291 | ### Examples |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 292 | |
| 293 | Refer to [examples/README.md](examples/README.md). |
| 294 | |
| 295 | ## WPT (Web Platform Tests) |
| 296 | |
| 297 | WPT is added as |
| 298 | a [git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules). To get run |
| 299 | WPT tests: |
| 300 | |
| 301 | ### Check out and setup WPT |
| 302 | |
| 303 | #### 1. Check out WPT |
| 304 | |
| 305 | ```sh |
| 306 | git submodule update --init |
| 307 | ``` |
| 308 | |
| 309 | #### 2. Go to the WPT folder |
| 310 | |
| 311 | ```sh |
| 312 | cd wpt |
| 313 | ``` |
| 314 | |
| 315 | #### 3. Set up virtualenv |
| 316 | |
| 317 | Follow the [_System |
| 318 | Setup_](https://web-platform-tests.org/running-tests/from-local-system.html#system-setup) |
| 319 | instructions. |
| 320 | |
| 321 | #### 4. Setup `hosts` file |
| 322 | |
| 323 | Follow |
| 324 | the [`hosts` File Setup](https://web-platform-tests.org/running-tests/from-local-system.html#hosts-file-setup) |
| 325 | instructions. |
| 326 | |
| 327 | ##### 4.a On Linux, macOS or other UNIX-like system |
| 328 | |
| 329 | ```sh |
| 330 | ./wpt make-hosts-file | sudo tee -a /etc/hosts |
| 331 | ``` |
| 332 | |
| 333 | ##### 4.b On **Windows** |
| 334 | |
| 335 | This must be run in a PowerShell session with Administrator privileges: |
| 336 | |
| 337 | ```sh |
| 338 | python wpt make-hosts-file | Out-File $env:SystemRoot\System32\drivers\etc\hosts -Encoding ascii -Append |
| 339 | ``` |
| 340 | |
| 341 | If you are behind a proxy, you also need to make sure the domains above are excluded |
| 342 | from your proxy lookups. |
| 343 | |
Randolf Jung | bcb3bc8 | 2023-06-26 16:30:14 | [diff] [blame] | 344 | #### 5. Set `BROWSER_BIN` |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 345 | |
Randolf Jung | bcb3bc8 | 2023-06-26 16:30:14 | [diff] [blame] | 346 | Set the `BROWSER_BIN` environment variable to a Chrome, Edge or Chromium binary to launch. |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 347 | For example, on macOS: |
| 348 | |
| 349 | ```sh |
| 350 | # Chrome |
Randolf Jung | bcb3bc8 | 2023-06-26 16:30:14 | [diff] [blame] | 351 | export BROWSER_BIN="/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary" |
| 352 | export BROWSER_BIN="/Applications/Google Chrome Dev.app/Contents/MacOS/Google Chrome Dev" |
| 353 | export BROWSER_BIN="/Applications/Google Chrome Beta.app/Contents/MacOS/Google Chrome Beta" |
| 354 | export BROWSER_BIN="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" |
| 355 | export BROWSER_BIN="/Applications/Chromium.app/Contents/MacOS/Chromium" |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 356 | |
| 357 | # Edge |
Randolf Jung | bcb3bc8 | 2023-06-26 16:30:14 | [diff] [blame] | 358 | export BROWSER_BIN="/Applications/Microsoft Edge Canary.app/Contents/MacOS/Microsoft Edge Canary" |
| 359 | export BROWSER_BIN="/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge" |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 360 | ``` |
| 361 | |
| 362 | ### Run WPT tests |
| 363 | |
| 364 | #### 1. Make sure you have Chrome Dev installed |
| 365 | |
| 366 | https://www.google.com/chrome/dev/ |
| 367 | |
Randolf | 5543146 | 2023-03-29 13:00:36 | [diff] [blame] | 368 | #### 2. Build Chromedriver BiDi |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 369 | |
| 370 | Oneshot: |
| 371 | |
| 372 | ```sh |
| 373 | npm run build |
| 374 | ``` |
| 375 | |
| 376 | Continuously: |
| 377 | |
| 378 | ```sh |
Randolf Jung | bcb3bc8 | 2023-06-26 16:30:14 | [diff] [blame] | 379 | npm run build --watch |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 380 | ``` |
| 381 | |
| 382 | #### 3. Run |
| 383 | |
| 384 | ```sh |
Randolf Jung | bcb3bc8 | 2023-06-26 16:30:14 | [diff] [blame] | 385 | npm run wpt -- webdriver/tests/bidi/ |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 386 | ``` |
| 387 | |
| 388 | ### Update WPT expectations if needed |
| 389 | |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 390 | ```sh |
Randolf Jung | bcb3bc8 | 2023-06-26 16:30:14 | [diff] [blame] | 391 | UPDATE_EXPECTATIONS=true npm run wpt -- webdriver/tests/bidi/ |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 392 | ``` |
| 393 | |
| 394 | ## How does it work? |
| 395 | |
| 396 | The architecture is described in the |
| 397 | [WebDriver BiDi in Chrome Context implementation plan](https://docs.google.com/document/d/1VfQ9tv0wPSnb5TI-MOobjoQ5CXLnJJx9F_PxOMQc8kY) |
| 398 | . |
| 399 | |
| 400 | There are 2 main modules: |
| 401 | |
| 402 | 1. backend WS server in `src`. It runs webSocket server, and for each ws connection |
| 403 | runs an instance of browser with BiDi Mapper. |
| 404 | 2. front-end BiDi Mapper in `src/bidiMapper`. Gets BiDi commands from the backend, |
| 405 | and map them to CDP commands. |
| 406 | |
Alex Rudenko | 5fe99f8 | 2023-10-06 12:01:27 | [diff] [blame] | 407 | ## Contributing |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 408 | |
| 409 | The BiDi commands are processed in the `src/bidiMapper/commandProcessor.ts`. To add a |
| 410 | new command, add it to `_processCommand`, write and call processor for it. |
| 411 | |
| 412 | ### Publish new `npm` release |
| 413 | |
Alex Rudenko | 1552f2b | 2023-07-11 11:18:32 | [diff] [blame] | 414 | #### Automatic release |
Randolf Jung | bcb3bc8 | 2023-06-26 16:30:14 | [diff] [blame] | 415 | |
Alex Rudenko | 1552f2b | 2023-07-11 11:18:32 | [diff] [blame] | 416 | We use [release-please](https://github.com/googleapis/release-please) to automate releases. When a release should be done, check for the release PR in our [pull requests](https://github.com/GoogleChromeLabs/chromium-bidi/pulls) and merge it. |
Randolf Jung | bcb3bc8 | 2023-06-26 16:30:14 | [diff] [blame] | 417 | |
| 418 | #### Manual release |
| 419 | |
| 420 | 1. Dry-run |
| 421 | |
| 422 | ```sh |
| 423 | npm publish --dry-run |
| 424 | ``` |
| 425 | |
Randolf | 5543146 | 2023-03-29 13:00:36 | [diff] [blame] | 426 | 1. Open a PR bumping the chromium-bidi version number in `package.json` for review: |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 427 | |
| 428 | ```sh |
Alex Rudenko | 1552f2b | 2023-07-11 11:18:32 | [diff] [blame] | 429 | npm version patch -m 'chore: Release v%s' --no-git-tag-version |
Randolf | b0fe9c1 | 2023-03-06 14:03:48 | [diff] [blame] | 430 | ``` |
| 431 | |
| 432 | Instead of `patch`, use `minor` or `major` [as needed](https://semver.org/). |
| 433 | |
Randolf | 5543146 | 2023-03-29 13:00:36 | [diff] [blame] | 434 | 1. After the PR is reviewed, [create a GitHub release](https://github.com/GoogleChromeLabs/chromium-bidi/releases/new) specifying the tag name matching the bumped version. |
| 435 | Our CI then automatically publishes the new release to npm based on the tag name. |
Randolf Jung | 3e52631 | 2023-08-08 06:20:39 | [diff] [blame] | 436 | |
| 437 | #### Roll into Chromium |
| 438 | |
Alex Rudenko | b013f87 | 2023-09-29 05:56:03 | [diff] [blame] | 439 | This section assumes you already have a Chromium set-up locally, |
| 440 | and knowledge on [how to submit changes to the repo](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/contributing.md). |
| 441 | Otherwise submit an issue for a project maintainer. |
Randolf Jung | 3e52631 | 2023-08-08 06:20:39 | [diff] [blame] | 442 | |
Alex Rudenko | b013f87 | 2023-09-29 05:56:03 | [diff] [blame] | 443 | 1. Create a new branch in chromium `src/`. |
| 444 | 2. Update the mapper version: |
Randolf Jung | 3e52631 | 2023-08-08 06:20:39 | [diff] [blame] | 445 | |
Alex Rudenko | b013f87 | 2023-09-29 05:56:03 | [diff] [blame] | 446 | ```shell |
| 447 | third_party/bidimapper/pull.sh |
| 448 | third_party/bidimapper/build.sh |
Randolf Jung | 3e52631 | 2023-08-08 06:20:39 | [diff] [blame] | 449 | ``` |
| 450 | |
Alex Rudenko | b013f87 | 2023-09-29 05:56:03 | [diff] [blame] | 451 | 3. Submit a CL with bug `chromedriver:4226`. |
| 452 | 4. [Regenerate WPT expectations metadata](https://chromium.googlesource.com/chromium/src/+/HEAD/docs/testing/web_platform_tests_wptrunner.md#updating-expectations): |
| 453 | |
| 454 | 4.1. Trigger a build and test run: |
| 455 | |
| 456 | ```shell |
| 457 | third_party/blink/tools/blink_tool.py update-metadata --build="linux-blink-rel" |
| 458 | ``` |
| 459 | |
| 460 | 4.2. Once the test completes on the builder, rerun that command to update the metadata. |
| 461 | Commit the changes (if any), and upload the new patch to the CL. |
| 462 | |
| 463 | 5. Add appropriate reviewers or comment the CL link on the PR. |