xref: /aosp_15_r20/external/skia/modules/canvaskit/tests/legacy_init.js (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1// The increased timeout is especially needed with larger binaries
2// like in the debug/gpu build
3jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;
4
5let CanvasKit = null;
6const _LoadCanvasKit = new Promise((resolve, reject) => {
7    console.log('canvaskit loading', new Date());
8    CanvasKitInit({
9        locateFile: (file) => '/build/'+file,
10    }).then((loaded) => {
11        console.log('canvaskit loaded', new Date());
12        CanvasKit = loaded;
13        resolve();
14    }).catch((e) => {
15        console.error('canvaskit failed to load', new Date(), e);
16        reject();
17    });
18});
19
20const EverythingLoaded = Promise.all([_LoadCanvasKit]);