Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/chrome.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ jobs:
run: dart pub get

- name: Test chrome
run: dart test -j 1 -p chrome
run: dart test --timeout 2x -j 1 -p chrome
9 changes: 8 additions & 1 deletion lib/src/platform_check/web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@ class PlatformWeb extends Platform {
static bool useBuiltInRng = false;

PlatformWeb() {
useBuiltInRng = false;
try {
Random.secure();
useBuiltInRng = true;
} on UnsupportedError {
useBuiltInRng = false;
// Random.secure() normally throws this error if
// no cryptographically secure random number source is available.
} catch (e) {
// For Node.js with dart2js compiler, the following error is expected.
if (e.runtimeType.toString() == 'UnknownJsTypeError') {
// This error is internal to 'dart:_js_helper'.
}
}
}

Expand Down