Layout Tests Tips

The recommendations here are intended to help you write new tests that go through code review with a minimal number of round trips, remain useful as Blink evolves, and serve as an asset (rather than a liability) for the team.

While reading existing layout tests, please keep in mind that they represent snapshots taken over many years of an ever-evolving collective opinion of what good Web pages and solid tests should look like. Thus, it should not come as a surprise that most existing layout tests are not consistent with these recommendations, and are not even consistent with each other.

This document intentionally uses should a lot more than must, as defined in RFC 2119. Writing layout tests is a careful act of balancing many concerns, and this humble document cannot possibly capture the context that rests in the head of an experienced Blink engineer.

General Principles

This section contains guidelines adopted from web-platform-tests documentation and WebKit's Wiki page on Writing good test cases, with Blink-specific flavoring.