Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@dkurt
Copy link
Member

@dkurt dkurt commented Jun 8, 2024

Pull Request Readiness Checklist

  • Firefox tests passed

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake
force_builders=Custom
build_image:Docs=docs-js
build_image:Custom=javascript
buildworker:Custom=linux-1,linux-4,linux-f1

@dkurt dkurt changed the title Fix Opencv.js tests Fix OpenCV.js tests Jun 8, 2024
@dkurt dkurt marked this pull request as draft June 9, 2024 05:59
@dkurt dkurt force-pushed the opencv_js_tests_update branch from fff57a3 to 28d0eb1 Compare June 10, 2024 08:17
@dkurt dkurt marked this pull request as ready for review June 10, 2024 08:30
@asmorkalov
Copy link
Contributor

I was able to build the PR, but not test. Firefox dev console says:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:///home/vlad/Projects/opencv-build/bin/haarcascade_frontalface_default.xml. (Reason: CORS request not http).

Uncaught Loading data file "haarcascade_frontalface_default.xml" failed. [opencv.js:31:9911237](file:///home/vlad/Projects/opencv-build/bin/opencv.js)
    asyncLoad file:///home/vlad/Projects/opencv-build/bin/opencv.js:31

@asmorkalov
Copy link
Contributor

@dkurt how do you fixed CORS requirement?

@dkurt
Copy link
Member Author

dkurt commented Jun 11, 2024

@asmorkalov, sorry, tested everything without the latest changes with data file.

@dkurt
Copy link
Member Author

dkurt commented Jun 11, 2024

@asmorkalov, FF test passed for me

source ./emsdk/emsdk_env.sh
emcmake python ./opencv/platforms/js/build_js.py build_js --build_test
npx http-server build_js/bin
QUnit 2.0.1; Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0

Tests completed in 2210 milliseconds.
610 assertions of 610 passed, 0 failed.

@opencv-alalek
Copy link
Contributor

how do you fixed CORS requirement

This is the problem with "file://". Need to emulate web-server.

Use @dkurt suggestion or run python -m http.server and open http://localhost:8000/bin/tests.html

@asmorkalov
Copy link
Contributor

Yes, I got the point. I used local file without web server. Server version works for me!

@asmorkalov asmorkalov added this to the 4.11.0 milestone Jun 11, 2024
@asmorkalov asmorkalov merged commit a03b813 into opencv:4.x Jun 11, 2024
@opencv-alalek opencv-alalek removed their request for review June 11, 2024 12:49
@mshabunin mshabunin mentioned this pull request Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants