1cb93a386Sopenharmony_ci
2cb93a386Sopenharmony_ci---
3cb93a386Sopenharmony_cititle: "Blink layout tests"
4cb93a386Sopenharmony_cilinkTitle: "Blink layout tests"
5cb93a386Sopenharmony_ci
6cb93a386Sopenharmony_ci---
7cb93a386Sopenharmony_ci
8cb93a386Sopenharmony_ci
9cb93a386Sopenharmony_ciHow to land Skia changes that change Blink layout test results.
10cb93a386Sopenharmony_ci
11cb93a386Sopenharmony_ciChanges that affect a small number of layout test results
12cb93a386Sopenharmony_ci---------------------------------------------------------
13cb93a386Sopenharmony_ciChanges affecting fewer than ~20 layout tests can be rebaselined without
14cb93a386Sopenharmony_cispecial coordination with the Blink gardener using these steps:
15cb93a386Sopenharmony_ci
16cb93a386Sopenharmony_ci1. Prepare your Skia change, taking note of which layout tests will turn red
17cb93a386Sopenharmony_ci   \(see http://www.chromium.org/developers/testing/webkit-layout-tests for more
18cb93a386Sopenharmony_ci   detail on running the Blink layout tests\).
19cb93a386Sopenharmony_ci2. Check in your code to the Skia repo.
20cb93a386Sopenharmony_ci3. Ahead of the Skia auto roll including your change, manually push a change to the
21cb93a386Sopenharmony_ci   Blink LayoutTests/TestExpectations [file](https://chromium.googlesource.com/chromium/src/+/main/third_party/blink/web_tests/TestExpectations), flagging tests expected to fail as a result of your change as follows:
22cb93a386Sopenharmony_ci   foo/bar/test-name.html [ Failure Pass ]  # Needs rebaseline
23cb93a386Sopenharmony_ci
24cb93a386Sopenharmony_ci4. Wait for the Skia roll to land successfully.
25cb93a386Sopenharmony_ci5. Check in another change to the Blink TestExpectations file removing all the
26cb93a386Sopenharmony_ci  skipped test expectations you add earlier, an run `git cl rebaseline` which will prompt the automatic rebaseline.
27cb93a386Sopenharmony_ci
28cb93a386Sopenharmony_ci
29cb93a386Sopenharmony_ci
30cb93a386Sopenharmony_ciChanges that affect a large number of test results
31cb93a386Sopenharmony_ci--------------------------------------------------
32cb93a386Sopenharmony_ciWhere a 'large number' or 'many' means more than about 20.
33cb93a386Sopenharmony_ciFollow the instructions below:
34cb93a386Sopenharmony_ci
35cb93a386Sopenharmony_ciIn the following the term 'code suppression' means a build flag \(a\.k\.a\. define\).
36cb93a386Sopenharmony_ciSuch code suppressions should be given a name with the form SK\_IGNORE\_xxx\_FIX.
37cb93a386Sopenharmony_ci
38cb93a386Sopenharmony_ciUpdating the version of Skia in Chromium is called a 'roll'.
39cb93a386Sopenharmony_ciThe Auto Roll Bot performs this roll multiple times per day, and can also be done manually.
40cb93a386Sopenharmony_ciSee https://chromium.googlesource.com/chromium/src/+log/main/DEPS and search for skia\-deps\-roller.
41cb93a386Sopenharmony_ci
42cb93a386Sopenharmony_ci### Setup
43cb93a386Sopenharmony_ci#### Code suppression does not yet exist \- Direct method
44cb93a386Sopenharmony_ci1. Make a change in Skia which will change many Blink layout tests.
45cb93a386Sopenharmony_ci2. Put the change behind a code suppression.
46cb93a386Sopenharmony_ci3. Check in the change to the Skia repository.
47cb93a386Sopenharmony_ci4. Manually roll Skia or append the autoroll with the code suppression to
48cb93a386Sopenharmony_ci   Chromium's 'skia/chromium\_skia\_defines\.gypi'
49cb93a386Sopenharmony_ci
50cb93a386Sopenharmony_ci#### Code suppression does not yet exist \- Alternate method
51cb93a386Sopenharmony_ci1. Add code suppression to Chromium's 'skia/chromium\_skia\_defines\.gypi' before making code
52cb93a386Sopenharmony_ci   changes in Skia.
53cb93a386Sopenharmony_ci2. Make a change in Skia which will change many Blink layout tests.
54cb93a386Sopenharmony_ci3. Put the change behind a code suppression.
55cb93a386Sopenharmony_ci4. Check in the change to the Skia repository.
56cb93a386Sopenharmony_ci5. Wait for Skia roll into Chromium.
57cb93a386Sopenharmony_ci
58cb93a386Sopenharmony_ci#### Code suppression exists in header
59cb93a386Sopenharmony_ci1. Remove code suppression from header file in Chromium and add code suppression to
60cb93a386Sopenharmony_ci   Chromium's 'skia/chromium\_skia\_defines\.gypi'.
61cb93a386Sopenharmony_ci   The code suppression cannot be in a header file and a defined in a gyp file at the
62cb93a386Sopenharmony_ci   same time or a multiple definition warning will be treated as an error and break
63cb93a386Sopenharmony_ci   the Chromium build.
64cb93a386Sopenharmony_ci
65cb93a386Sopenharmony_ci### Rebaseline
66cb93a386Sopenharmony_ci1. Choose a time when the Blink tree is likely to be quiet. Avoid PST afternoons in
67cb93a386Sopenharmony_ci   particular. The bigger the change, the more important this is. Regardless,
68cb93a386Sopenharmony_ci   determine who the Blink gardener is and notify them. You will be making the
69cb93a386Sopenharmony_ci   Chromium\.WebKit tree very red for an extended period, and the gardener needs to
70cb93a386Sopenharmony_ci   know that they are not expected to fix it.
71cb93a386Sopenharmony_ci2. Create a CL removing the code suppression from Chromium's
72cb93a386Sopenharmony_ci   skia/chromium\_skia\_defines\.gypi while simultaneously adding [ NeedsRebaseline ]
73cb93a386Sopenharmony_ci   lines to Blink's LayoutTests/TestExpectations [file](https://chromium.googlesource.com/chromium/src/+/main/third_party/blink/web_tests/TestExpectations).
74cb93a386Sopenharmony_ci   Then the auto rebaseline bot will take care of the work of actually checking in the
75cb93a386Sopenharmony_ci   new images. This is generally acceptable for up to 600 or so rebaselined images.
76cb93a386Sopenharmony_ci   Above that you might still use [ NeedsRebaseline ], but it's best to coordinate with
77cb93a386Sopenharmony_ci   the gardener. This should go through the CQ cleanly.
78cb93a386Sopenharmony_ci3. Be careful with tests that are already failing or flakey. These may or may not need
79cb93a386Sopenharmony_ci   to be rebaselined and flakey tests should not be removed from TestExpectations
80cb93a386Sopenharmony_ci   regardless. In such cases revert the TestExpectations changes before committing.
81cb93a386Sopenharmony_ci4. If you are not the one handling the cleanup step, please open a Skia Issue of the
82cb93a386Sopenharmony_ci   form
83cb93a386Sopenharmony_ci   Title: "Remove code suppression SK\_IGNORE\_xxx\_FIX\."
84cb93a386Sopenharmony_ci   Comment: "Code suppression SK\_IGNORE\_xxx\_FIX rebaselined with Blink revision
85cb93a386Sopenharmony_ci   123456\." and assign it to the individual responsible for the cleanup step.
86cb93a386Sopenharmony_ci
87cb93a386Sopenharmony_ci### Cleanup
88cb93a386Sopenharmony_ci1. Remove the now unused old code from Skia and any defines which were introduced
89cb93a386Sopenharmony_ci   to suppress the new code.
90cb93a386Sopenharmony_ci2. Check in the cleanup change to the Skia repository.
91cb93a386Sopenharmony_ci3. Wait for Skia roll into Chromium.
92cb93a386Sopenharmony_ci
93cb93a386Sopenharmony_ci
94