Skip to content

Commit 4a19984

Browse files
committed
Showcase that the crypto api is broken
1 parent 0c53dea commit 4a19984

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package org.scalajs.dom.tests.chrome
2+
3+
import org.junit.Test
4+
5+
class CryptoTests {
6+
import org.scalajs.dom
7+
import scala.scalajs.js.typedarray._
8+
9+
@Test final def cryptoGetRandomValuesWork(): Unit = {
10+
// This fails
11+
dom.crypto.getRandomValues(Array.ofDim[Byte](8).toTypedArray)
12+
}
13+
14+
@Test final def webcryptoGetRandomValuesWork(): Unit = {
15+
dom.webcrypto.getRandomValues(Array.ofDim[Byte](8).toTypedArray)
16+
}
17+
18+
@Test final def cryptoCryptoGetRandomValuesWork(): Unit = {
19+
dom.crypto.crypto.getRandomValues(Array.ofDim[Byte](8).toTypedArray)
20+
}
21+
}

0 commit comments

Comments
 (0)