blob: af3a31bf1c8f6521552fd48eea68717fc45e09cf [file]
<!DOCTYPE html>
<body>
<script src="../../js/resources/js-test-pre.js"></script>
<script src="../resources/common.js"></script>
<script src="../resources/multiple-fields-value-set-empty.js"></script>
<script>
testSettingEmptyStringClearsSubFields('time');
debug('');
input = document.createElement('input');
input.type = 'time';
input.min = '11:23:45';
input.step = '60';
// Because the step value is 60 seconds, the seconds fields is read-only.
document.body.appendChild(input);
debug('Initial text: ' + getUserAgentShadowTextContent(input));
debug('Empty value should not clear read-only fields.');
shouldBeEqualToString('input.value = ""; getUserAgentShadowTextContent(input)', '--:--:45 --');
debug('Empty value should clear only editable fields.');
input.focus();
shouldBeEqualToString('eventSender.keyDown("upArrow"); getUserAgentShadowTextContent(input)', '01:--:45 --');
shouldBeEqualToString('input.value = ""; getUserAgentShadowTextContent(input)', '--:--:45 --');
</script>
<script src="../../js/resources/js-test-post.js"></script>
</body>