1
+ <pre class='metadata'>
2
+ Group : WHATWG
3
+ Title : Browser Testing API
4
+ Shortname : browser-test
5
+ Editor : James Graham, Mozilla https://mozilla.org, [email protected] , https://hoppipolla.co.uk
6
+ Boilerplate : conformance no
7
+ Complain About : accidental-2119 yes, missing-example-ids yes
8
+ Abstract : This document defines APIs that provide additional testing functionality in browsers
9
+ Text Macro : COMMIT-SHA LOCAL COPY
10
+ Text Macro : TWITTER _
11
+ </pre>
12
+
13
+ Introduction {#intro}
14
+ =====================
15
+
16
+ Testing browsers often requires use of specialised API surface that is
17
+ not suitable for exposing to web authors, for example because it could
18
+ undermine platform invariants, or allow behaviour that could put users
19
+ at risk. This can make writing cross-browser tests difficult because
20
+ each implementation of the web platform will have its own approach to
21
+ defining such test APIs. The [[!WEBDRIVER|WebDriver]] standard
22
+ provides some of these APIs, with a focus on automated testing of web
23
+ applications. However for testing of browser implementations
24
+ themselves, there are some additional APIs that don't fit into the
25
+ WebDriver framework, but are nevertheless important to testing.
26
+
27
+ This specification defines additional in-browser APIs for use in
28
+ tests, but which are not suitable to enable for end users. The primary
29
+ client of these APIs is the web-platform-tests
30
+ testsuite.
31
+
32
+ Infrastructure {#infrastructure}
33
+ ================================
34
+
35
+ <p> This specification depends on the Infra Standard. [[!INFRA]]
36
+
37
+ <p> This specification uses terminology from the IDL standard
38
+ [[!WEBIDL]]
39
+
40
+ Availability {#availability}
41
+ ============================
42
+
43
+ The interfaces defined in this specification must not be enabled in
44
+ the default shipping configuration of user agents. They must only be
45
+ enabled in testing configurations for example with special build
46
+ flags, or when a specific non-default preference is set.
47
+
48
+ The TestUtils Object {#the-testutils-object}
49
+ ============================================
50
+
51
+ <xmp class=idl>
52
+ [Exposed=Window,Worker]
53
+ interface TestUtils {
54
+ Promise<void> gc();
55
+ };
56
+
57
+ partial interface mixin WindowOrWorkerGlobalScope {
58
+ readonly attribute TestUtils testUtils;
59
+ };
60
+ </xmp>
61
+
62
+ The `gc()` method must run these steps:
63
+
64
+ 1. Let |p| be a new promise.
65
+
66
+ 2. Run the following [=in parallel=] :
67
+
68
+ 2.1 Run implemenation defined steps to perform a garbage collection
69
+ covering at least the [=entry Realm=] .
70
+
71
+ 2.2 Resolve |p|
0 commit comments