volume_nonfinite.html (616B)
1 <!doctype html> 2 <meta charset="utf-8"> 3 <title>Setting HTMLMediaElement.volume to non-finite numbers</title> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <div id=log></div> 7 <script> 8 ["audio", "video"].forEach(function(aElement) { 9 [NaN, Infinity, -Infinity].forEach(function(aValue) { 10 test(function() { 11 var el = document.createElement(aElement); 12 assert_throws_js(TypeError, function() { 13 el.volume = aValue; 14 }); 15 }, "Setting " + aElement + ".volume to " + String(aValue) + " should throw a TypeError"); 16 }); 17 }); 18 </script>