blob: e2ed703fc025149443a0e81190dc866626ad3885 (
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/js-test.js"></script>
</head>
<body onload="runBodyLoaded()">
<iframe id=iframe srcdoc="<input type=date id='test1'><input type='date' id='test2' value='1234-05-06'>"></iframe>
<script>
description('Checks reloading page resets input values');
window.jsTestIsAsync = true;
var iframe = document.getElementById('iframe');
var testInput1;
var testInput2;
function runBodyLoaded()
{
testInput1 = iframe.contentDocument.getElementById('test1');
testInput2 = iframe.contentDocument.getElementById('test2');
debug('Initial values:');
shouldBeEqualToString('testInput1.value', '');
shouldBeEqualToString('testInput2.value', '1234-05-06');
testInput1.value = '2012-10-01';
testInput2.value = '2012-11-01';
iframe.addEventListener('load', parent.runOnIFrameLoad);
iframe.contentWindow.location.reload();
}
function runOnIFrameLoad()
{
testInput1 = iframe.contentDocument.getElementById('test1');
testInput2 = iframe.contentDocument.getElementById('test2');
debug('Reloaded values:');
shouldBeEqualToString('testInput1.value', '');
shouldBeEqualToString('testInput2.value', '1234-05-06');
iframe.parentNode.removeChild(iframe);
finishJSTest();
}
</script>
</body>
</html>
|