blob: ff0d57021cdb546d5517e8a555ae54e7daae095d [file] [log] [blame]
<html>
<head>
<script src="../resources/js-test.js"></script>
<script src="../resources/user-gesture-utils.js"></script>
<script src="vibration-utils.js"></script>
</head>
<body>
<h4 id="test"></h4>
<script>
description('Tests that bad input throws exceptions in the Vibration API.');
// Simulates a user click for vibrate to be allowed.
var element = document.getElementById("test");
simulateUserClick(element.offsetLeft + 2, element.offsetTop + 2);
shouldThrow("navigator.vibrate()");
shouldBe("navigator.vibrate(1, 2)", "true");
shouldBe("navigator.vibrate([1], [2])", "true");
</script>
</body>
</html>