summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_error.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_error.html')
-rw-r--r--testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_error.html33
1 files changed, 33 insertions, 0 deletions
diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_error.html b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_error.html
new file mode 100644
index 000000000..d6324ea56
--- /dev/null
+++ b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_error.html
@@ -0,0 +1,33 @@
+<!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>