summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/docs/test-templates.md
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/docs/test-templates.md
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/docs/test-templates.md')
-rw-r--r--testing/web-platform/tests/docs/test-templates.md135
1 files changed, 135 insertions, 0 deletions
diff --git a/testing/web-platform/tests/docs/test-templates.md b/testing/web-platform/tests/docs/test-templates.md
new file mode 100644
index 000000000..3738ebf13
--- /dev/null
+++ b/testing/web-platform/tests/docs/test-templates.md
@@ -0,0 +1,135 @@
+This page contains templates for creating tests. The template syntax
+is compatible with several popular editors including TextMate, Sublime
+Text, and emacs' YASnippet mode.
+
+Each template is given in two forms, one minimal and one including
+[extra metadata](css-metadata.html). Usually the metadata is required
+by CSS tests and optional for other tests.
+
+Templates for filenames are also given. In this case `{}` is used to
+delimit text to be replaced and `#` represents a digit.
+
+## Reftests
+
+### Minimal Reftest
+
+``` html
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>${1:Test title}</title>
+<link rel="match" href="${2:URL of match}">
+<style>
+ ${3:Test CSS}
+</style>
+<body>
+ ${4:Test content}
+</body>
+```
+
+Filename: `{test-topic}-###.html`
+
+### Reftest Including Metadata
+
+``` html
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>${1:Test area}: ${2:Scope of test}</title>
+<link rel="author" title="${3:Author's name}" href="${4:Contact link}">
+<link rel="help" href="${5:Link to tested section}">
+<link rel="match" href="${6:URL of match}">
+<meta name="flags" content="${7:Requirement flags}">
+<meta name="assert" content="${8:Description of what you're trying to test}">
+<style>
+ ${9:Test CSS}
+</style>
+<body>
+ ${10:Test content}
+</body>
+```
+
+Filename: `{test-topic}-###.html`
+
+### Minimal Reftest Reference:
+
+``` html
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>${1:Reference title}</title>
+<style>
+ ${2:Reference CSS}
+</style>
+<body>
+ ${3:Reference content}
+</body>
+```
+
+Filename: `{description}.html` or `{test-topic}-###-ref.html`
+
+### Reference Including Metadata
+
+``` html
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>${1:Reference title}</title>
+<link rel="author" title="${2:Author's name}" href="${3:Contact link}">
+<style>
+ ${4:Reference CSS}
+</style>
+<body>
+ ${5:Reference content}
+</body>
+```
+
+Filename: `{description}.html` or `{test-topic}-###-ref.html`
+
+## testharness.js tests
+
+### Minimal Script Test
+
+``` html
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>${1:Test title}</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+${2:Test body}
+</script>
+```
+
+Filename: `{test-topic}-###.html`
+
+### Script Test With Metadata
+
+``` html
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>${1:Test title}</title>
+<link rel="author" title="${2:Author's name}" href="${3:Contact link}">
+<link rel="help" href="${4:Link to tested section}">
+<meta name="flags" content="${5:Requirement flags}">
+<meta name="assert" content="${6:Description of what you're trying to test}">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+${7:Test body}
+</script>
+```
+
+Filename: `{test-topic}-###.html`
+
+### Manual Test
+
+``` html
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>${1:Test title}</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+setup({explicit_timeout: true});
+${2:Test body}
+</script>
+```
+
+Filename: `{test-topic}-###-manual.html`