Files
UXP-Fixed/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_error.html
T
2018-02-02 04:16:08 -05:00

34 lines
1.4 KiB
HTML

<!DOCTYPE html>
<meta charset="utf-8">
<title>Presentation API PresentationRequest for Controlling User Agent (Error)</title>
<link rel="author" title="Franck William Taffo" href="http://www.fokus.fraunhofer.de">
<link rel="help" href="http://w3c.github.io/presentation-api/#dfn-controlling-user-agent">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(function() {
assert_throws(new TypeError(), function() {
new PresentationRequest();
});
}, 'Call PresentationRequest() constructor without presentation URL. TypeError Exception expected.');
test(function() {
assert_throws('NotSupportedError', function() {
new PresentationRequest([]);
});
}, 'Call PresentationRequest constructor with an empty sequence. NotSupportedError Exception expected.');
test(function() {
assert_throws('SyntaxError', function() {
new PresentationRequest('http://@');
});
}, 'Call PresentationRequest constructor with an invalid URL. SyntaxError Exception expected.');
test(function() {
assert_throws('SyntaxError', function() {
new PresentationRequest(['presentation.html', 'http://@']);
});
}, 'Call PresentationRequest constructor with a sequence of URLs, one of them invalid. SyntaxError Exception expected.');
</script>