summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/week-multiple-fields/week-multiple-fields-reset-value-after-reloads.html
blob: e565ed713e0753ecd996d9d4a54d56ddcfc3d0e0 (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=week id='test1'><input type='week' id='test2' value='1234-W05'>"></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-W05');
    testInput1.value = '2012-W10';
    testInput2.value = '2012-W11';
    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-W05');
    iframe.parentNode.removeChild(iframe);
    finishJSTest();
}
</script>
</body>
</html>