Fixes for canvaskit karma tests in google3

Change-Id: I4945f99016ed7424ed0fe8cca1f0006396a1ad44
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317857
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
This commit is contained in:
Nathaniel Nifong 2020-09-18 15:26:39 -04:00 committed by Skia Commit-Bot
parent 443d2c17b7
commit ba615e892f
2 changed files with 7 additions and 4 deletions

View File

@ -8,13 +8,14 @@ module.exports = function(config) {
config.files.unshift(
// pattern is a path relative to google3 root referring to any file
// provided by a target in the data attribute of the js_library of the test.
{ pattern: 'third_party/skia/HEAD/modules/canvaskit/minimal_skottie_wasm/minimal_skottie_cc.wasm', included:false, served:true},
{ pattern: 'third_party/skia/HEAD/modules/canvaskit/minimal_skottie_wasm/minimal_skottie_cc.js', included:true, served:false},
{ pattern: 'third_party/skia/HEAD/modules/canvaskit/tests/assets/animated_gif.json', included:false, served:true},
{ pattern: 'third_party/skia/HEAD/modules/canvaskit/tests/util.js', included:true, served:false},
{ pattern: 'third_party/skia/HEAD/modules/canvaskit/canvaskit_wasm/canvaskit_cc.wasm', included:false, served:true},
{ pattern: 'third_party/skia/HEAD/modules/canvaskit/canvaskit_wasm/canvaskit_cc.js', included:true, served:false},
{ pattern: 'third_party/skia/HEAD/modules/canvaskit/tests/assets/*', included:false, served:true},
);
// proxies have the following form
// {'/dir-to-serve/': '/base/dir-relative-to-google3-root'}
config.proxies['/canvaskit/'] = '/base/third_party/skia/HEAD/modules/canvaskit/minimal_skottie_wasm/';
config.proxies['/canvaskit/'] = '/base/third_party/skia/HEAD/modules/canvaskit/canvaskit_wasm/';
config.proxies['/assets/'] = '/base/third_party/skia/HEAD/modules/canvaskit/tests/assets/';
};

View File

@ -34,6 +34,7 @@ describe('Skottie behavior', () => {
console.warn('Skipping test because not compiled with skottie');
return;
}
expect(promises[1]).not.toBe('NOT FOUND');
const animation = CanvasKit.MakeManagedAnimation(promises[1], {
'flightAnim.gif': promises[0],
});
@ -63,6 +64,7 @@ describe('Skottie behavior', () => {
console.warn('Skipping test because not compiled with skottie');
return;
}
expect(promises[0]).not.toBe('NOT FOUND');
const bounds = CanvasKit.LTRBRect(0, 0, 500, 500);
canvas.clear(CanvasKit.WHITE);