| <!DOCTYPE html> |
| <meta charset="utf-8"> |
| <title>Worklet: addModule() on an insecure context</title> |
| <body> |
| <script src="../resources/testharness.js"></script> |
| <script src="../resources/testharnessreport.js"></script> |
| <script src="/resources/get-host-info.js"></script> |
| <script> |
| |
| // This test should not be upstreamed to WPT because Worklets are now restricted |
| // to secure contexts by Chrome's policy. |
| |
| const realTimeContext = new AudioContext(); |
| const offlineContext = new OfflineAudioContext(1, 1, 44100); |
| |
| if (window.location.origin != get_host_info().UNAUTHENTICATED_ORIGIN) { |
| test(t => { |
| assert_not_equals(undefined, CSS.layoutWorklet); |
| assert_not_equals(undefined, CSS.paintWorklet); |
| assert_not_equals(undefined, CSS.animationWorklet); |
| assert_not_equals(undefined, realTimeContext.audioWorklet); |
| assert_not_equals(undefined, offlineContext.audioWorklet); |
| }, 'Worklets should be available on a secure context.'); |
| window.location = get_host_info().UNAUTHENTICATED_ORIGIN + |
| window.location.pathname; |
| } else { |
| test(t => { |
| assert_equals(undefined, CSS.layoutWorklet); |
| assert_equals(undefined, CSS.paintWorklet); |
| assert_equals(undefined, CSS.animationWorklet); |
| assert_equals(undefined, realTimeContext.audioWorklet); |
| assert_equals(undefined, offlineContext.audioWorklet); |
| }, 'Worklets should not be available on an insecure context.'); |
| } |
| |
| </script> |
| </body> |