skia2/modules/canvaskit/tests/canvaskitinit.js
Kevin Lubick 3b760b6fa8 [canvaskit] Add full build to npm release.
Also rename //modules/canvaskit/canvaskit to //modules/canvaskit/npm_build
to make it more clear the purpose of that folder (what we ship to
npm and stage our builds for local testing).

Bug: skia:11203
Change-Id: I4299ded97d14f4155c36798d60e88a660ce6fe6a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372392
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-02-23 14:40:43 +00:00

19 lines
584 B
JavaScript

// The increased timeout is especially needed with larger binaries
// like in the debug/gpu build
jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;
let CanvasKit = null;
const LoadCanvasKit = new Promise((resolve, reject) => {
console.log('canvaskit loading', new Date());
CanvasKitInit({
locateFile: (file) => '/npm_build/'+file,
}).then((loaded) => {
console.log('canvaskit loaded', new Date());
CanvasKit = loaded;
resolve();
}).catch((e) => {
console.error('canvaskit failed to load', new Date(), e);
reject();
});
});