<!DOCTYPE html>
<body>
<script src="../../../resources/js-test.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\u202f--');
debug('Empty value should clear only editable fields.');
input.focus();
shouldBeEqualToString('eventSender.keyDown("ArrowUp"); getUserAgentShadowTextContent(input)', '01:--:45\u202f--');
shouldBeEqualToString('input.value = ""; getUserAgentShadowTextContent(input)', '--:--:45\u202f--');
</script>
</body>