blob: 8b1fe8416bc14a2bf628cdc79d8a15ea501f5c5a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
<!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 --');
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>
</body>
|