Merge pull request #17403 from wangmengHB:master

Fix Test Case: in latest version, window.cv is a promise instance that makes most test case failed.

* Fix Browser Test Case: In latest version, window.cv is a promise instance

In latest version of opencv.js, window.cv is promise instance.
So that most of the test cases is run failed.
This commit is to fix browser test case.

* Add comment for backward compatible

Add comments for backward compatible
pull/17424/head
Meng Wang 5 years ago committed by GitHub
parent c6b60e219d
commit ab2c59b80e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      modules/js/test/tests.html

@ -49,8 +49,17 @@
postRun: [] , postRun: [] ,
onRuntimeInitialized: function() { onRuntimeInitialized: function() {
console.log("Emscripten runtime is ready, launching QUnit tests..."); console.log("Emscripten runtime is ready, launching QUnit tests...");
//console.log(cv.getBuildInformation()); if (window.cv instanceof Promise) {
QUnit.start(); window.cv.then((target) => {
window.cv = target;
//console.log(cv.getBuildInformation());
QUnit.start();
})
} else {
// for backward compatible
// console.log(cv.getBuildInformation());
QUnit.start();
}
}, },
print: (function() { print: (function() {
var element = document.getElementById('output'); var element = document.getElementById('output');

Loading…
Cancel
Save