Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /presentation-api/controlling-ua/PresentationRequest_error.https.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>Constructing a PresentationRequest (Error)</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(() => {
assert_throws_js(TypeError, () => {
new PresentationRequest();
}, 'Call PresentationRequest() constructor without presentation URL. TypeError Exception expected.');
assert_throws_dom('NotSupportedError', () => {
new PresentationRequest([]);
}, 'Call PresentationRequest constructor with an empty sequence. NotSupportedError Exception expected.');
assert_throws_dom('SyntaxError', () => {
}, 'Call PresentationRequest constructor with an invalid URL. SyntaxError Exception expected.');
assert_throws_dom('NotSupportedError', () => {
}, 'Call PresentationRequest constructor with an unsupported URL. NotSupportedError expected.');
assert_throws_dom('SyntaxError', function() {
}, 'Call PresentationRequest constructor with a sequence of URLs, one of them invalid. SyntaxError Exception expected.');
assert_throws_dom('NotSupportedError', function() {
}, 'Call PresentationRequest constructor only with a sequence of unsupported URLs. NotSupportedError Exception expected.');
});
</script>