[canvaskit] Add catchException everywhere
This should make the logs in the bots more actionable by showing
the error and trace.
This also fixes the API change causing mysterious red.
Bug: skia:
Change-Id: I38df2bb4557041f8bdfefcae5c8d95b58e770033
Reviewed-on: https://skia-review.googlesource.com/c/168180
Reviewed-by: Kevin Lubick <kjlubick@google.com>
diff --git a/modules/pathkit/tests/path.spec.js b/modules/pathkit/tests/path.spec.js
index 852435b..7ee1aad 100644
--- a/modules/pathkit/tests/path.spec.js
+++ b/modules/pathkit/tests/path.spec.js
@@ -26,7 +26,7 @@
}
it('supports.equals()', function(done) {
- LoadPathKit.then(() => {
+ LoadPathKit.then(catchException(done, () => {
let path = drawSimplePath();
let otherPath = drawSimplePath();
let blank = PathKit.NewPath();
@@ -44,11 +44,11 @@
otherPath.delete();
blank.delete();
done();
- });
+ }));
});
it('has a copy constructor', function(done) {
- LoadPathKit.then(() => {
+ LoadPathKit.then(catchException(done, () => {
let orig = drawSimplePath();
let copy = new PathKit.SkPath(orig);
@@ -58,11 +58,11 @@
orig.delete();
copy.delete();
done();
- });
+ }));
});
it('has a copy method', function(done) {
- LoadPathKit.then(() => {
+ LoadPathKit.then(catchException(done, () => {
let orig = drawSimplePath();
let copy = orig.copy();
@@ -72,11 +72,11 @@
orig.delete();
copy.delete();
done();
- });
+ }));
});
it('can create a copy with MakePath', function(done) {
- LoadPathKit.then(() => {
+ LoadPathKit.then(catchException(done, () => {
let orig = drawSimplePath();
let copy = PathKit.NewPath(orig);
@@ -86,7 +86,7 @@
orig.delete();
copy.delete();
done();
- });
+ }));
});
});
@@ -109,7 +109,7 @@
describe('bounds and rect', function(){
it('dynamically updates getBounds()', function(done){
- LoadPathKit.then(() => {
+ LoadPathKit.then(catchException(done, () => {
// Based on test_bounds_crbug_513799
let path = PathKit.NewPath();
expect(path.getBounds()).toEqual(PathKit.LTRBRect(0, 0, 0, 0));
@@ -121,11 +121,11 @@
expect(path.getBounds()).toEqual(PathKit.LTRBRect(-5, -8, 3, 4));
path.delete();
done();
- });
+ }));
});
it('has getBounds() and computeTightBounds()', function(done){
- LoadPathKit.then(() => {
+ LoadPathKit.then(catchException(done, () => {
// Based on PathOpsTightBoundsIllBehaved
let path = PathKit.NewPath();
path.moveTo(1, 1);
@@ -138,7 +138,7 @@
path.delete();
done();
- });
+ }));
});
});
@@ -159,7 +159,7 @@
describe('Command arrays', function(){
it('does NOT approximates conics when dumping as toCmds', function(done){
- LoadPathKit.then(() => {
+ LoadPathKit.then(catchException(done, () => {
let path = PathKit.NewPath();
path.moveTo(20, 120);
path.arc(20, 120, 18, 0, 1.75 * Math.PI);
@@ -178,7 +178,7 @@
path.delete();
done();
- });
+ }));
});
});