<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description('Check if stepping-up and -down for date input fields from renderer does not work.');

var input = document.createElement('input');

function sendKey(keyName) {
    var event = document.createEvent('KeyboardEvent');
    event.initKeyboardEvent('keydown', true, true, document.defaultView, keyName);
    input.dispatchEvent(event);
}

function stepUp(value, step, max, optionalStepCount) {
    input.value = value;
    sendKey('Up');
    return input.value;
}

function stepDown(value, step, min, optionalStepCount) {
    input.value = value;
    sendKey('Down');
    return input.value;
}

input.type = 'date';
shouldBe('stepUp("2010-02-10")', '"2010-02-10"');
// The following check was disabled because it tries to open a calendar picker and DRT crashes.
//shouldBe('stepDown("2010-02-10")', '"2010-02-10"');

debug('');
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>
</html>
