blob: 662f12e128d62800630c2a6083d1c1e0e03c6cac [file] [log] [blame]
<html>
<head>
<script src="../js/resources/js-test-pre.js"></script>
<script>
function countAutofilledElements() {
return document.querySelectorAll(':-webkit-autofill').length;
}
function test() {
if (window.testRunner) {
testRunner.dumpAsText();
}
var field = document.getElementById('field');
if (window.testRunner) {
testRunner.setAutofilled(field, true);
} else {
testFailed('This test requires a LayoutTestController.');
return;
}
shouldBe('countAutofilledElements()', '1');
var form = document.getElementById('form');
form.reset();
shouldBe('countAutofilledElements()', '0');
}
</script>
<style>
#tf {
color: #FFFFFF;
background-color: #FFFFFF;
}
</style>
</head>
<body onload="test()">
This tests that a field's autofilled state is reverted when the form is reset. It can only be run using DumpRenderTree.<br>
<form id="form">
<input type="text" id="field" />
</form>
<div id="console"></div>
</body>
</html>