From 1ed3cff5a73e974b56dd116cbfd90a0bdf309c83 Mon Sep 17 00:00:00 2001 From: Ken Russell Date: Tue, 11 Aug 2020 12:52:54 -0700 Subject: [PATCH] Support WebKit's MiniBrowser in webglHarnessCollectGarbage(). (#3137) This allows the expando-loss.html and expando-loss-2.html tests to be run correctly in the MiniBrowser with the following two environment variables set: export JSC_useDollarVM=1 export __XPC_JSC_useDollarVM=1 Thanks to Yusuke Suzuki from Apple for this tip. --- conformance-suites/2.0.0/js/js-test-pre.js | 8 ++++++++ sdk/tests/js/js-test-pre.js | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/conformance-suites/2.0.0/js/js-test-pre.js b/conformance-suites/2.0.0/js/js-test-pre.js index e1e70188fb..626440a566 100644 --- a/conformance-suites/2.0.0/js/js-test-pre.js +++ b/conformance-suites/2.0.0/js/js-test-pre.js @@ -708,6 +708,14 @@ function webglHarnessCollectGarbage() { return; } + // WebKit's MiniBrowser with the following environment variables set: + // export JSC_useDollarVM=1 + // export __XPC_JSC_useDollarVM=1 + if (window.$vm) { + window.$vm.gc(); + return; + } + function gcRec(n) { if (n < 1) return {}; diff --git a/sdk/tests/js/js-test-pre.js b/sdk/tests/js/js-test-pre.js index 8a3cede5a0..b6202a2789 100644 --- a/sdk/tests/js/js-test-pre.js +++ b/sdk/tests/js/js-test-pre.js @@ -737,6 +737,14 @@ function webglHarnessCollectGarbage() { return; } + // WebKit's MiniBrowser with the following environment variables set: + // export JSC_useDollarVM=1 + // export __XPC_JSC_useDollarVM=1 + if (window.$vm) { + window.$vm.gc(); + return; + } + function gcRec(n) { if (n < 1) return {};