Files
servo/tests/wpt/web-platform-tests/presentation-api/controlling-ua/PresentationRequest_error.html

39 lines
1.6 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(new TypeError(), function() {
new PresentationRequest(null);
});
}, 'Call PresentationRequest constructor with null 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(':invalid');
});
}, 'Call PresentationRequest constructor with an invalid URL. SyntaxError Exception expected.');
test(function() {
assert_throws('SyntaxError', function() {
new PresentationRequest(['presentation.html', ':invalid']);
});
}, 'Call PresentationRequest constructor with a sequence of URLs, one of them invalid. SyntaxError Exception expected.');
</script>