diff --git a/lint.whitelist b/lint.whitelist index ac2d30427cfe37..f9688ed58b98c0 100644 --- a/lint.whitelist +++ b/lint.whitelist @@ -108,6 +108,7 @@ CONSOLE: resources/check-layout-th.js CONSOLE: resources/chromium/* CONSOLE: resources/idlharness.js CONSOLE: streams/resources/test-utils.js +CONSOLE: weakrefs/resources/test-utils.js CONSOLE: service-workers/service-worker/resources/navigation-redirect-other-origin.html CONSOLE: service-workers/service-worker/navigation-redirect.https.html CONSOLE: service-workers/service-worker/resources/clients-get-other-origin.html diff --git a/weakrefs/META.yml b/weakrefs/META.yml new file mode 100644 index 00000000000000..f8ef8886f3ba74 --- /dev/null +++ b/weakrefs/META.yml @@ -0,0 +1 @@ +spec: https://tc39.es/proposal-weakrefs/ diff --git a/weakrefs/finalization-group-basic.html b/weakrefs/finalization-group-basic.html new file mode 100644 index 00000000000000..831ebf87a080ea --- /dev/null +++ b/weakrefs/finalization-group-basic.html @@ -0,0 +1,32 @@ + + + + diff --git a/weakrefs/finalization-group-cleanupSome-basic.html b/weakrefs/finalization-group-cleanupSome-basic.html new file mode 100644 index 00000000000000..118d64ed486248 --- /dev/null +++ b/weakrefs/finalization-group-cleanupSome-basic.html @@ -0,0 +1,32 @@ + + + + diff --git a/weakrefs/finalization-group-error.html b/weakrefs/finalization-group-error.html new file mode 100644 index 00000000000000..60fa1da2ca12df --- /dev/null +++ b/weakrefs/finalization-group-error.html @@ -0,0 +1,31 @@ + + + + diff --git a/weakrefs/resources/test-utils.js b/weakrefs/resources/test-utils.js new file mode 100644 index 00000000000000..a836346969d48b --- /dev/null +++ b/weakrefs/resources/test-utils.js @@ -0,0 +1,16 @@ +export default function() { + if (self.gc) { + // Use --expose_gc for V8 (and Node.js) + // to pass this flag at chrome launch use: --js-flags="--expose-gc" + // Exposed in SpiderMonkey shell as well + self.gc(); + } else if (self.GCController) { + // Present in some WebKit development environments + GCController.collect(); + } else { + /* eslint-disable no-console */ + console.warn('Tests are running without the ability to do manual garbage collection. They will still work, but ' + + 'coverage will be suboptimal.'); + /* eslint-enable no-console */ + } +};