[canvaskit] Remove additional copies of CanvasKit when testing
Speculative fix for flaky test bot. My guess is that since there were 3 .spec.js that were all trying to load CanvasKit at the same time, the browser would fail to compile/process all that WASM and timeout. This cleans it up so there's only one copy of CanvasKit shared by all tests. Bug: skia:8810 Change-Id: I60a77dae93b7c3e5d45923b4af93a223ac26220c Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198161 Auto-Submit: Kevin Lubick <kjlubick@google.com> Reviewed-by: Ben Wagner <benjaminwagner@google.com> Commit-Queue: Ben Wagner <benjaminwagner@google.com>
This commit is contained in:
parent
2a889a84a2
commit
cb4eb612f0
@ -14,6 +14,7 @@ module.exports = function(config) {
|
||||
{ pattern: 'perf/assets/*', included:false, served:true},
|
||||
'../../modules/pathkit/perf/perfReporter.js',
|
||||
'canvaskit/bin/canvaskit.js',
|
||||
'tests/canvaskitinit.js',
|
||||
'perf/*.bench.js'
|
||||
],
|
||||
|
||||
|
@ -14,6 +14,7 @@ module.exports = function(config) {
|
||||
{ pattern: 'tests/assets/*', included:false, served:true},
|
||||
'../../modules/pathkit/tests/testReporter.js',
|
||||
'canvaskit/bin/canvaskit.js',
|
||||
'tests/canvaskitinit.js',
|
||||
'tests/util.js',
|
||||
'tests/*.spec.js'
|
||||
],
|
||||
|
@ -1,22 +1,4 @@
|
||||
// The increased timeout is especially needed with larger binaries
|
||||
// like in the debug/gpu build
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 20000;
|
||||
|
||||
describe('CanvasKit\'s Animation', function() {
|
||||
// Note, don't try to print the CanvasKit object - it can cause Karma/Jasmine to lock up.
|
||||
var CanvasKit = null;
|
||||
const LoadCanvasKit = new Promise(function(resolve, reject) {
|
||||
if (CanvasKit) {
|
||||
resolve();
|
||||
} else {
|
||||
CanvasKitInit({
|
||||
locateFile: (file) => '/canvaskit/'+file,
|
||||
}).ready().then((_CanvasKit) => {
|
||||
CanvasKit = _CanvasKit;
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
const LOTTIE_ANIMATIONS = ['lego_loader', 'drinks', 'confetti', 'onboarding'];
|
||||
|
||||
|
@ -1,22 +1,4 @@
|
||||
// The increased timeout is especially needed with larger binaries
|
||||
// like in the debug/gpu build
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 20000;
|
||||
|
||||
describe('CanvasKit\'s Canvas 2d Behavior', function() {
|
||||
// Note, don't try to print the CanvasKit object - it can cause Karma/Jasmine to lock up.
|
||||
var CanvasKit = null;
|
||||
const LoadCanvasKit = new Promise(function(resolve, reject) {
|
||||
if (CanvasKit) {
|
||||
resolve();
|
||||
} else {
|
||||
CanvasKitInit({
|
||||
locateFile: (file) => '/canvaskit/'+file,
|
||||
}).ready().then((_CanvasKit) => {
|
||||
CanvasKit = _CanvasKit;
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
let container = document.createElement('div');
|
||||
document.body.appendChild(container);
|
||||
|
13
experimental/canvaskit/tests/canvaskitinit.js
Normal file
13
experimental/canvaskit/tests/canvaskitinit.js
Normal file
@ -0,0 +1,13 @@
|
||||
// The increased timeout is especially needed with larger binaries
|
||||
// like in the debug/gpu build
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 20000;
|
||||
|
||||
let CanvasKit = null;
|
||||
const LoadCanvasKit = new Promise(function(resolve, reject) {
|
||||
CanvasKitInit({
|
||||
locateFile: (file) => '/canvaskit/'+file,
|
||||
}).ready().then((loaded) => {
|
||||
CanvasKit = loaded;
|
||||
resolve();
|
||||
});
|
||||
});
|
@ -1,23 +1,4 @@
|
||||
// The increased timeout is especially needed with larger binaries
|
||||
// like in the debug/gpu build
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 20000;
|
||||
|
||||
describe('CanvasKit\'s Path Behavior', function() {
|
||||
// Note, don't try to print the CanvasKit object - it can cause Karma/Jasmine to lock up.
|
||||
var CanvasKit = null;
|
||||
const LoadCanvasKit = new Promise(function(resolve, reject) {
|
||||
if (CanvasKit) {
|
||||
resolve();
|
||||
} else {
|
||||
CanvasKitInit({
|
||||
locateFile: (file) => '/canvaskit/'+file,
|
||||
}).ready().then((_CanvasKit) => {
|
||||
CanvasKit = _CanvasKit;
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
let container = document.createElement('div');
|
||||
document.body.appendChild(container);
|
||||
const CANVAS_WIDTH = 600;
|
||||
|
@ -1,23 +1,4 @@
|
||||
// The increased timeout is especially needed with larger binaries
|
||||
// like in the debug/gpu build
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 20000;
|
||||
|
||||
describe('CanvasKit\'s Path Behavior', function() {
|
||||
// Note, don't try to print the CanvasKit object - it can cause Karma/Jasmine to lock up.
|
||||
var CanvasKit = null;
|
||||
const LoadCanvasKit = new Promise(function(resolve, reject) {
|
||||
if (CanvasKit) {
|
||||
resolve();
|
||||
} else {
|
||||
CanvasKitInit({
|
||||
locateFile: (file) => '/canvaskit/'+file,
|
||||
}).ready().then((_CanvasKit) => {
|
||||
CanvasKit = _CanvasKit;
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
let container = document.createElement('div');
|
||||
document.body.appendChild(container);
|
||||
const CANVAS_WIDTH = 600;
|
||||
|
Loading…
Reference in New Issue
Block a user