test exception on unknown key in option parameter
authorDominique Hazael-Massieux <dom@w3.org>
Thu, 31 May 2012 21:13:30 +0200
changeset 18 704d66b7a077
parent 17 f2ca42fed58c
child 19 913318fcd6d1
test exception on unknown key in option parameter
submitted/W3C/unknownkey-option-param.html
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/submitted/W3C/unknownkey-option-param.html	Thu May 31 21:13:30 2012 +0200
@@ -0,0 +1,33 @@
+<!doctype html>
+<html>
+<head>
+<title>getUserMedia({doesnotexist:true}) aborts with NOT_SUPPORTED_ERR</title>
+<link rel="author" title="Dominique Hazael-Massieux" href="mailto:dom@w3.org"/>
+<link rel="help" href="http://dev.w3.org/2011/webrtc/editor/getusermedia.html#navigatorusermedia">
+<link rel='stylesheet' href='/resources/testharness.css' media='all'/>
+</head>
+<body>
+<h1>Description</h1>
+<p>This test checks that getUserMedia with an unknown value in the options parameter raises a NOT_SUPPORTED_ERR exception.</p>
+
+<div id='log'></div>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script src=featuredetection.js></script>
+<script src=prefix.js></script>
+<script>
+var t = async_test("Tests that getUserMedia raises a NOT_SUPPORTED_ERR exception when used with an unknown key in the options paramter");
+if (window.navigator.getUserMedia) { 
+  t.step( function () {
+     assert_throws("NOT_SUPPORTED_ERR", 
+                   function () { 
+                     navigator.getUserMedia({doesnotexist:true}, function (stream) {
+                       assert_unreached("This should never be triggered since doesnotexist is not a valid key for the options parameter");
+                     })
+                   });
+     t.done();
+  });
+}
+</script>
+</body>
+</html>