Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
-
CI results over the last 22 days
- Manifest: gfx/tests/browser/browser.toml
/* Any copyright is dedicated to the Public Domain.
"use strict";
const TEST_URL =
const WORKER_COUNT = 4;
// Repeat in fresh processes to exercise loader initialization.
const ATTEMPTS = 10;
add_task(async function test_concurrent_first_buffer_fontfaces() {
for (let attempt = 0; attempt < ATTEMPTS; attempt++) {
await BrowserTestUtils.withNewTab(
{ gBrowser, url: TEST_URL, forceNewProcess: true },
async browser => {
info(
`Attempt ${attempt} in process ${browser.browsingContext.currentWindowGlobal.osPid}`
);
const results = await SpecialPowers.spawn(
browser,
[WORKER_COUNT],
async count => {
const faces =
await content.wrappedJSObject.createFontFacesConcurrently(count);
return Array.from(faces, ({ statusAfterConstructor, error }) => ({
statusAfterConstructor,
error,
}));
}
);
Assert.equal(results.length, WORKER_COUNT, "Got all the results");
const failures = results
.map((result, worker) => ({ worker, ...result }))
.filter(
({ statusAfterConstructor, error }) =>
statusAfterConstructor == "error" || error
);
Assert.deepEqual(
failures,
[],
`All the FontFaces loaded in attempt ${attempt}`
);
}
);
}
});