JS files to support running jasmine tests in google3
accompanied by cl/299139086
Change-Id: I9d05aab8171313d2efd2f47c0007b716e4f5a76e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275763
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
diff --git a/modules/canvaskit/catchExceptionNop.js b/modules/canvaskit/catchExceptionNop.js
new file mode 100644
index 0000000..bb897ca
--- /dev/null
+++ b/modules/canvaskit/catchExceptionNop.js
@@ -0,0 +1,13 @@
+// When running the jasmine tests in google3, this can be a nop because catching
+// logs is handled already by the testing framework.
+// original here http://shortn/_HeVXSB2tRh
+function catchException(done, fn) {
+ return fn;
+}
+
+// This function would normally upload results to gold, but we don't do that
+// when running the test in google3. If necessary, the test could have scuba
+// turned on to serve that purpose.
+function reportSurface(foo, bar, done) {
+ done();
+}
diff --git a/modules/canvaskit/karma.google3.conf.js b/modules/canvaskit/karma.google3.conf.js
new file mode 100644
index 0000000..51deb7c
--- /dev/null
+++ b/modules/canvaskit/karma.google3.conf.js
@@ -0,0 +1,20 @@
+// Configuration for running the tests in google3
+// The only thing to specify is the static file dependencies.
+// For everything else the defaults for the karam_web_test_suite are used.
+
+module.exports = function(config) {
+ // By default this contains any srcs in the build rule, but we need to add our
+ // generated js and wasm files, and they need to come first, hence unshift
+ 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},
+ );
+
+ // 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['/assets/'] = '/base/third_party/skia/HEAD/modules/canvaskit/tests/assets/';
+};