Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement unit tests for the isSameOrigin and createValidAbsoluteUrl utility functions and use the const keyword for constants in src/shared/util.js #10061

Merged
merged 2 commits into from
Sep 11, 2018

Conversation

timvandermeij
Copy link
Contributor

This helps to increase test coverage of the src/shared/util.js file.

@Snuffleupagus Would you be willing to review this?

@timvandermeij
Copy link
Contributor Author

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_test from @timvandermeij received. Current queue size: 0

Live output at: http://54.67.70.0:8877/37b6a56524605b2/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @timvandermeij received. Current queue size: 0

Live output at: http://54.215.176.217:8877/900d0f6ea27bf4c/output.txt

@timvandermeij timvandermeij changed the title Implement unit tests for the isSameOrigin and createValidAbsoluteUrl utulity functions and use the const keyword for constants in src/shared/util.js Implement unit tests for the isSameOrigin and createValidAbsoluteUrl utility functions and use the const keyword for constants in src/shared/util.js Sep 11, 2018
Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More unit-test coverage is always great to have, and collecting the constants in one place will make the file easier to deal with; thank you for doing this!

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.215.176.217:8877/900d0f6ea27bf4c/output.txt

Total script time: 24.69 mins

  • Font tests: Passed
  • Unit tests: FAILED
  • Regression tests: FAILED

Image differences available at: http://54.215.176.217:8877/900d0f6ea27bf4c/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/37b6a56524605b2/output.txt

Total script time: 36.41 mins

  • Font tests: Passed
  • Unit tests: FAILED
  • Regression tests: Passed

…rl` utility functions

Moreover, mark the `isValidProtocol` function as private since it's only
used in the utilities file and is not (meant to be) exported.
Moreover, move general constants to the top of the file, i.e., those
that are not closely tied to a function in the file.
@timvandermeij
Copy link
Contributor Author

It turns out that the URL implementation in Firefox and Chrome differs slightly, so for the mailto: protocol Firefox gives origin null and Chrome gives origin mailto://. I switched to blob: instead which shows the same behavior in both browsers.

/botio unittest

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_unittest from @timvandermeij received. Current queue size: 0

Live output at: http://54.215.176.217:8877/f17e299397cd71d/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_unittest from @timvandermeij received. Current queue size: 0

Live output at: http://54.67.70.0:8877/8780f9538abf36d/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/f17e299397cd71d/output.txt

Total script time: 5.28 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/8780f9538abf36d/output.txt

Total script time: 8.12 mins

  • Unit Tests: Passed

@timvandermeij timvandermeij merged commit 9c764da into mozilla:master Sep 11, 2018
@timvandermeij timvandermeij deleted the unit-testing branch September 11, 2018 14:31
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