Export changes from WebKit to WPT (Web Platform Tests)

If you are working on a WebKit patch that adds new tests or modifies the tests located in the directory LayoutTests/imported/w3c/web-platform-tests you should export this changes to WPT.

Any change done in this directory will be lost (if not exported to WPT) the next time those tests are re-imported from upstream WPT.

  • Important: If you are simply importing changes coming from upstream WPT into WebKit then you can ignore this. This guide is only for when changes are done to the tests (and those changes are not coming directly from WPT itself)

The guide below describes how the process for exporting changes from WebKit to WPT works.

Process for exporting changes from WebKit to WPT

  1. Upload your original patch to the WebKit bugzilla and ask for review.
  2. Create a pull-request in the WPT repository with the relevant changes for WPT with the following title:
    WebKit export of${bugidfromabove}
    • You can use the script Tools/Scripts/export-w3c-test-changes to help exporting this changes to WPT.
      • This script will try to automatically create a WPT PR from your WebKit patch, but sometimes it fails. So you may need to export the changes and create the WPT PR manually.
  1. Ensure that in bug from point 1. (above), you add the link to the PR from point 2. in the See Also field.
    • This is important, as the bot that automatically approves pull-requests from WebKit (see below) checks this.
  1. Get a review (r+) for the WebKit patch uploaded to the bug from above (point 1.)
  2. A bot will automatically approve your WPT PR linked to this WebKit bug:
    • There is a bot watching all PRs on WPT with the title "WebKit export of.."
    • So, once you get review (r+) for your patch on WebKit, this bot will automatically approve the PR on WPT.
    • In order for this process to work you should take into account this two things:
      • The title of the PR in WPT has to contain the URL to the WebKit bug. Its recommended to use the format: WebKit export of${bugidfromabove}
      • The bug in WebKit from above (point 1.) has to have a link to the WPT PR in the See Also field.
      • You need to get reviewed (r+) the patch in the WebKit bug
  3. Land the PR in WPT
  4. Finally land the patch in WebKit

Notes about exporting changes from WebKit to WPT

  • On WPT, testharness tests don't require a -expected.txt file. There are no expectations for them, they should all simply PASS. So don't export the -expected.txt files.
  • On WPT, the reference for ref-tests is not determined by the filename like in WebKit (-expected.html), instead the test contains a link to it inside a <link rel="match" href="..."> header.
    • So you may need to use a different filename for the ref-test expectation file in WebKit and WPT.

Import tests

Importing WPT tests

Last modified 2 years ago Last modified on Nov 24, 2021 1:46:49 AM