OLD | NEW |
1 Fetch API LayoutTests README | 1 Fetch API LayoutTests README |
2 | 2 |
3 This directory contains Fetch API layout tests. | 3 This directory contains Fetch API layout tests. |
4 Tests should conform to Service Worker Testing style[1]. | 4 Tests should conform to Service Worker Testing style[1]. |
5 | 5 |
6 1: http://www.chromium.org/blink/serviceworker/testing | 6 1: http://www.chromium.org/blink/serviceworker/testing |
7 | 7 |
8 # generator.py | 8 # generator.py |
9 | 9 |
10 The files under | 10 The files under |
11 - /fetch/window/ | 11 - /fetch/window/ |
12 - /fetch/workers/ | 12 - /fetch/workers/ |
13 - /fetch/serviceworker/ | 13 - /fetch/serviceworker/ |
14 - /fetch/serviceworker-proxied/ | 14 - /fetch/serviceworker-proxied/ |
15 are generated by the generator. | 15 are generated by the generator. |
16 Run | 16 Run |
17 $ python generate.py | 17 $ python generate.py |
18 at this (/LayoutTests/http/tests/fetch/) directory to generate these files | 18 at this (/LayoutTests/http/tests/fetch/) directory to generate these files |
19 from templates script-tests/TEMPLATE*.html. | 19 from templates script-tests/TEMPLATE*.html. |
20 | 20 |
| 21 There are two kinds of tests. One is regular tests placed on script-tests |
| 22 directory and another is "thorough" tests placed on script-tests/thorough |
| 23 directory. Each has its own template files and default option settings. |
| 24 Note: thorough tests were called as "fetch-access-control" tests. auth.js |
| 25 was called as fetch-access-control-auth.js, for example. |
| 26 |
21 # Running on window, workers, serviceworker, serviceworker-proxied | 27 # Running on window, workers, serviceworker, serviceworker-proxied |
22 | 28 |
23 As it is exposed to Window and Worker, most (if not all) of tests are expected | 29 As it is exposed to Window and Worker, most (if not all) of tests are expected |
24 to run on Window, DedicatedWorker and ServiceWorker. | 30 to run on Window, DedicatedWorker and ServiceWorker. |
25 For each test (say X), we have | 31 For each test (say X), we have |
26 - a script X.js in /fetch/script-tests, | 32 - a script X.js in /fetch/script-tests, |
27 - /fetch/window/X.html Window test file, | 33 - /fetch/window/X.html Window test file, |
28 - /fetch/workers/X.html Worker test file, and | 34 - /fetch/workers/X.html Worker test file, and |
29 - /fetch/serviceworker/X.html ServiceWorker test file. | 35 - /fetch/serviceworker/X.html ServiceWorker test file. |
30 | 36 |
(...skipping 17 matching lines...) Expand all Loading... |
48 ----------------------------- ----------------------- ----------- ------------ | 54 ----------------------------- ----------------------- ----------- ------------ |
49 | 55 |
50 X.js is common to all options. | 56 X.js is common to all options. |
51 The test switches by location.href at runtime. | 57 The test switches by location.href at runtime. |
52 | 58 |
53 The options to be generated is listed in a line in X.js like: | 59 The options to be generated is listed in a line in X.js like: |
54 // OPTIONS: ,-other-https,-base-https-other-https | 60 // OPTIONS: ,-other-https,-base-https-other-https |
55 (Three files for OPTIONS = (empty), -other-https, -base-https-other-https are | 61 (Three files for OPTIONS = (empty), -other-https, -base-https-other-https are |
56 generated) | 62 generated) |
57 Default: | 63 Default: |
58 For fetch-access-control*: ,-other-https,-base-https-other-https | 64 For thorough tests: ,-other-https,-base-https-other-https |
59 For others: ,-base-https-other-https | 65 For others: ,-base-https-other-https |
60 | 66 |
61 # File structure | 67 # File structure |
62 | 68 |
63 Helper JS files and server side scripts are located on | 69 Helper JS files and server side scripts are located on |
64 /fetch/resources and /serviceworker/resources: | 70 /fetch/resources and /serviceworker/resources: |
65 - /serviceworker/resources/test-helpers.js | 71 - /serviceworker/resources/test-helpers.js |
66 Utility functions for all tests. | 72 Utility functions for all tests. |
67 Include this before X.js and from HTML files. | 73 Include this before X.js and from HTML files. |
68 - /fetch/resources/fetch-test-options.js | 74 - /fetch/resources/fetch-test-options.js |
69 Process test options for X.js. BASE_ORIGIN/OTHER_ORIGIN are defined here. | 75 Process test options for X.js. BASE_ORIGIN/OTHER_ORIGIN are defined here. |
70 Include this before X.js and fetch-access-control-util.js. | 76 Include this before X.js and thorough-util.js. |
71 - /fetch/resources/fetch-test-helpers.js | 77 - /fetch/resources/fetch-test-helpers.js |
72 Variables/functions commonly used from X.js. | 78 Variables/functions commonly used from X.js. |
73 Include this before X.js. | 79 Include this before X.js. |
74 - /fetch/resources/fetch-access-control-util.js | 80 - /fetch/resources/thorough-util.js |
75 Utility functions for fetch-access-control* tests. | 81 Utility functions for thorough tests. |
76 Include this before X.js in fetch-access-control* tests. | 82 Include this before X.js in thorough tests. |
77 - /fetch/resources/init.js | 83 - /fetch/resources/init.js |
78 Initialization script executed on window. | 84 Initialization script executed on window. |
79 Include this from HTML files. | 85 Include this from HTML files. |
80 | 86 |
81 Files needed from HTML/X.js files for each tests: | 87 Files needed from HTML/X.js files for each tests: |
82 ----------------------------------------------------- ------------ ------------ | 88 ----------------------------------------------------- ------------ ------------ |
83 HTML X.js | 89 HTML X.js |
84 Files wi wo sw swp wi wo sw swp | 90 Files wi wo sw swp wi wo sw swp |
85 ----------------------------------------------------- -- -- -- --- -- -- -- --- | 91 ----------------------------------------------------- -- -- -- --- -- -- -- --- |
86 /serviceworker/resources/test-helpers.js Y Y Y Y . . . . | 92 /serviceworker/resources/test-helpers.js Y Y Y Y . . . . |
87 /fetch/resources/fetch-test-options.js Y - - Y . . . . | 93 /fetch/resources/fetch-test-options.js Y - - Y . . . . |
88 /fetch/resources/fetch-test-helpers.js Y - - Y . Y Y . | 94 /fetch/resources/fetch-test-helpers.js Y - - Y . Y Y . |
89 /fetch/resources/fetch-access-control-util.js Y* - - Y* . Y* Y* . | 95 /fetch/resources/thorough-util.js Y* - - Y* . Y* Y* . |
90 /fetch/script-tests/X.js Y - - Y | 96 /fetch/script-tests/X.js Y - - Y |
91 /fetch/resources/init.js Y Y Y Y - - - - | 97 /fetch/resources/init.js Y Y Y Y - - - - |
92 ----------------------------------------------------- ------------ ------------ | 98 ----------------------------------------------------- ------------ ------------ |
93 wi/wo/sw/swp: window/workers/serviceworker/serviceworker-proxied. | 99 wi/wo/sw/swp: window/workers/serviceworker/serviceworker-proxied. |
94 Y: to be included. | 100 Y: to be included. |
95 -: not to be included. | 101 -: not to be included. |
96 .: included indirectly via HTML or fetch-test-helpers.js. | 102 .: included indirectly via HTML or fetch-test-helpers.js. |
97 Y*: fetch-access-control* tests only. | 103 Y*: thorough tests only. |
98 | 104 |
99 # PRESUBMIT.py | 105 # PRESUBMIT.py |
100 | 106 |
101 FIXME: currently PRESUBMIT.py is somehow outdated and thus disabled. | 107 FIXME: currently PRESUBMIT.py is somehow outdated and thus disabled. |
102 | 108 |
103 PRESUBMIT.py checks the existence of the files. | 109 PRESUBMIT.py checks the existence of the files. |
104 For each file in /fetch/script-tests, the | 110 For each file in /fetch/script-tests, the |
105 corresponding html files must exist at the paths listed above. | 111 corresponding html files must exist at the paths listed above. |
OLD | NEW |