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

Add window.crypto.getRandomValues test #1076

Merged
merged 1 commit into from
Oct 21, 2013
Merged

Add window.crypto.getRandomValues test #1076

merged 1 commit into from
Oct 21, 2013

Conversation


*/
define(['Modernizr'], function( Modernizr ) {
Modernizr.addTest('getrandomvalues', 'getRandomValues' in window.crypto);
Copy link
Member

Choose a reason for hiding this comment

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

This won't work if window.crypto is undefined. You want

'crypto' in window && 'getRandomValues' in window.crypto

@patrickkettner
Copy link
Member

Thanks for the pull!

Could you check out the failing tests and fix them up?

@komachi
Copy link
Contributor Author

komachi commented Oct 20, 2013

Oh, sorry. Fixed.

@patrickkettner
Copy link
Member

I'd love to have the polyfill if we are adding a test, so you don't have to remove it

you can add it to lib/polyfills.json

@patrickkettner
Copy link
Member

When you are all good to go, could you squish everything down to a single commit, too?

Thanks again!

@komachi
Copy link
Contributor Author

komachi commented Oct 20, 2013

Done. I found another polyfill (PolyCrypt), because NfWebCrypto seems to doesn't support getRandomValues (and it's a plugin for Chrome, not just a js library).

patrickkettner added a commit that referenced this pull request Oct 21, 2013
Add window.crypto.getRandomValues test
@patrickkettner patrickkettner merged commit 2ae1c7e into Modernizr:master Oct 21, 2013
@patrickkettner
Copy link
Member

thanks!

/*!
{
"name": "Web Cryptography API getRandomValues method",
"property": "window.crypto.getRandomValues",
Copy link
Member

Choose a reason for hiding this comment

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

Hi, this key/value pair is failing grunt-modernizr testing. I think the value should be "getrandomvalues", right?

Copy link
Member

Choose a reason for hiding this comment

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

dangit - yes. Sorry about that richard

fixing it now

Copy link
Member

Choose a reason for hiding this comment

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

fixed in d3a358d

patrickkettner added a commit to patrickkettner/Modernizr that referenced this pull request Feb 22, 2015
Add window.crypto.getRandomValues test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants