mirror of
https://github.com/opencv/opencv.git
synced 2025-06-11 03:33:28 +08:00
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
This commit is contained in:
parent
c6b60e219d
commit
ab2c59b80e
@ -49,8 +49,17 @@
|
||||
postRun: [] ,
|
||||
onRuntimeInitialized: function() {
|
||||
console.log("Emscripten runtime is ready, launching QUnit tests...");
|
||||
//console.log(cv.getBuildInformation());
|
||||
QUnit.start();
|
||||
if (window.cv instanceof Promise) {
|
||||
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() {
|
||||
var element = document.getElementById('output');
|
||||
|
Loading…
Reference in New Issue
Block a user