1
0
Fork 0
firefox/testing/web-platform/tests/measure-memory/main-frame-and-worker.https.window.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

27 lines
773 B
JavaScript

// META: script=/common/get-host-info.sub.js
// META: script=./resources/checker.js
// META: script=./resources/common.js
// META: timeout=long
'use strict';
promise_test(async testCase => {
assert_true(self.crossOriginIsolated);
const BYTES_PER_WORKER = 10 * 1024 * 1024;
const worker_url = await createWorker(BYTES_PER_WORKER);
const result = await performance.measureUserAgentSpecificMemory();
assert_greater_than_equal(result.bytes, BYTES_PER_WORKER);
checkMeasureMemory(result, [
{
url: window.location.href,
scope: 'Window',
container: null,
},
{
url: worker_url,
scope: 'DedicatedWorkerGlobalScope',
container: null,
},
]);
}, 'Well-formed result of performance.measureUserAgentSpecificMemory.');