Firefox works
The child content processes must be told to GC too.
This commit is contained in:
parent
07d8bb10d9
commit
66dd543816
|
|
@ -257,11 +257,10 @@ class PageHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
async ['Heap.collectGarbage']() {
|
async ['Heap.collectGarbage']() {
|
||||||
await new Promise((resolve) => {
|
Services.obs.notifyObservers(null, "child-gc-request");
|
||||||
Cu.schedulePreciseGC(() => {
|
Cu.forceGC();
|
||||||
resolve();
|
Services.obs.notifyObservers(null, "child-cc-request");
|
||||||
});
|
Cu.forceCC();
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async ['Network.getResponseBody']({requestId}) {
|
async ['Network.getResponseBody']({requestId}) {
|
||||||
|
|
|
||||||
|
|
@ -16,12 +16,12 @@
|
||||||
|
|
||||||
import { test as it, expect } from './pageTest';
|
import { test as it, expect } from './pageTest';
|
||||||
|
|
||||||
it('should work', async function({ page, browserName }) {
|
it.only('should work', async function({ page, browserName }) {
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
globalThis.thing = {};
|
globalThis.objectToDestroy = {};
|
||||||
globalThis.something = new WeakRef(globalThis.thing);
|
globalThis.weakRef = new WeakRef(globalThis.objectToDestroy);
|
||||||
});
|
});
|
||||||
await page.evaluate(() => globalThis.thing = null);
|
await page.evaluate(() => globalThis.objectToDestroy = null);
|
||||||
await page.forceGarbageCollection();
|
await page.forceGarbageCollection();
|
||||||
expect(await page.evaluate(() => globalThis.something.deref())).toBe(undefined);
|
expect(await page.evaluate(() => globalThis.weakRef.deref())).toBe(undefined);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue