test empty option parameter
authorDominique Hazael-Massieux <dom@w3.org>
Thu, 31 May 2012 21:15:43 +0200
changeset 19 913318fcd6d1
parent 18 704d66b7a077
child 20 bba03e47332c
test empty option parameter
submitted/W3C/empty-option-param.html
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/submitted/W3C/empty-option-param.html	Thu May 31 21:15:43 2012 +0200
@@ -0,0 +1,33 @@
+<!doctype html>
+<html>
+<head>
+<title>getUserMedia({}) 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 no 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 empty options paramter");
+if (window.navigator.getUserMedia) { 
+  t.step( function () {
+     assert_throws("NOT_SUPPORTED_ERR", 
+                   function () { 
+                     navigator.getUserMedia({}, 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>