<!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>