OLD | NEW |
1 # Writing Layout Tests | 1 # Writing Layout Tests |
2 | 2 |
3 _Layout tests_ is a bit of a misnomer. This term is | 3 _Layout tests_ is a bit of a misnomer. This term is |
4 [a part of our WebKit heritage](https://webkit.org/blog/1452/layout-tests-theory
/), | 4 [a part of our WebKit heritage](https://webkit.org/blog/1452/layout-tests-theory
/), |
5 and we use it to refer to every test that is written as a Web page (HTML, SVG, | 5 and we use it to refer to every test that is written as a Web page (HTML, SVG, |
6 or XHTML) and lives in | 6 or XHTML) and lives in |
7 [third_party/WebKit/LayoutTests/](../../third_party/WebKit/LayoutTests). | 7 [third_party/WebKit/LayoutTests/](../../third_party/WebKit/LayoutTests). |
8 | 8 |
9 [TOC] | 9 [TOC] |
10 | 10 |
11 ## Overview | 11 ## Overview |
12 | 12 |
13 Layout tests should be used to accomplish one of the following goals: | 13 Layout tests should be used to accomplish one of the following goals: |
14 | 14 |
15 1. The entire surface of Blink that is exposed to the Web should be covered by | 15 1. The entire surface of Blink that is exposed to the Web should be covered by |
16 tests that we contribute to the | 16 tests that we contribute to the |
17 [Web Platform Tests Project](https://github.com/w3c/web-platform-tests) | 17 [Web Platform Tests Project](./web_platform_tests.md) (WPT). This helps us |
18 (WPT). This helps us avoid regressions, and helps us identify Web Platform | 18 avoid regressions, and helps us identify Web Platform areas where the major |
19 areas where the major browsers don't have interoperable implementations. | 19 browsers don't have interoperable implementations. Furthermore, by |
20 Furthermore, by contributing to projects such as WPT, we share the burden of | 20 contributing to projects such as WPT, we share the burden of writing tests |
21 writing tests with the other browser vendors, and we help all the browsers | 21 with the other browser vendors, and we help all the browsers get better. This |
22 get better. This is very much in line with our goal to move the Web forward. | 22 is very much in line with our goal to move the Web forward. |
23 2. When a Blink feature cannot be tested using the tools provided by WPT, and | 23 2. When a Blink feature cannot be tested using the tools provided by WPT, and |
24 cannot be easily covered by | 24 cannot be easily covered by |
25 [C++ unit tests](https://cs.chromium.org/chromium/src/third_party/WebKit/Sour
ce/web/tests/?q=webframetest&sq=package:chromium&type=cs), | 25 [C++ unit tests](https://cs.chromium.org/chromium/src/third_party/WebKit/Sour
ce/web/tests/?q=webframetest&sq=package:chromium&type=cs), |
26 the feature must be covered by layout tests, to avoid unexpected regressions. | 26 the feature must be covered by layout tests, to avoid unexpected regressions. |
27 These tests will use Blink-specific testing APIs that are only available in | 27 These tests will use Blink-specific testing APIs that are only available in |
28 [content_shell](./layout_tests_in_content_shell.md). | 28 [content_shell](./layout_tests_in_content_shell.md). |
29 | 29 |
30 *** promo | 30 *** promo |
31 If you know that Blink layout tests are upstreamed to other projects, such as | 31 If you know that Blink layout tests are upstreamed to other projects, such as |
32 [test262](https://github.com/tc39/test262), please update this document. Most | 32 [test262](https://github.com/tc39/test262), please update this document. Most |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 * The `http/` directory hosts tests that require an HTTP server (see above). | 579 * The `http/` directory hosts tests that require an HTTP server (see above). |
580 * The `resources/` subdirectory in every directory contains binary files, such | 580 * The `resources/` subdirectory in every directory contains binary files, such |
581 as media files, and code that is shared by multiple test files. | 581 as media files, and code that is shared by multiple test files. |
582 | 582 |
583 *** note | 583 *** note |
584 Some layout tests consist of a minimal HTML page that references a JavaScript | 584 Some layout tests consist of a minimal HTML page that references a JavaScript |
585 file in `resources/`. Please do not use this pattern for new tests, as it goes | 585 file in `resources/`. Please do not use this pattern for new tests, as it goes |
586 against the minimality principle. JavaScript and CSS files should only live in | 586 against the minimality principle. JavaScript and CSS files should only live in |
587 `resources/` if they are shared by at least two test files. | 587 `resources/` if they are shared by at least two test files. |
588 *** | 588 *** |
OLD | NEW |