blob: 761082a57d1cbcf930d15033e45ec717cb80d7c1 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests the constructor for the SpeechRecognitionEvent DOM class.");
// Test constructor without initializer.
shouldBe("new webkitSpeechRecognitionEvent('eventType').bubbles", "false");
shouldBe("new webkitSpeechRecognitionEvent('eventType').cancelable", "false");
shouldBe("new webkitSpeechRecognitionEvent('eventType').results", "null");
shouldBe("new webkitSpeechRecognitionEvent('eventType').resultIndex", "0");
// Test passing bubbles in the initializer.
shouldBe("new webkitSpeechRecognitionEvent('eventType', { bubbles: false }).bubbles", "false");
shouldBe("new webkitSpeechRecognitionEvent('eventType', { bubbles: true }).bubbles", "true");
// Test passing cancelable in the initializer.
shouldBe("new webkitSpeechRecognitionEvent('eventType', { cancelable: false }).cancelable", "false");
shouldBe("new webkitSpeechRecognitionEvent('eventType', { cancelable: true }).cancelable", "true");
// Test passing resultIndex in the initializer.
shouldBe("new webkitSpeechRecognitionEvent('eventType', { resultIndex: 42 }).resultIndex", "42");
</script>
<script src="../../../resource/js-test-post.js"></script>
</body>
</html>