<!DOCTYPE html>
<html>
<body>
<p id="description">This test is setting suggested values on password fields,
and whether they should be revealed.</p>
<pre><input id="password1" type="password" value="initial value"><input id="password2" type="password" value="initial value"></pre>
<script src="../../resources/dump-as-markup.js"></script>
<script>
var password_with_masked_suggestion = document.getElementById('password1');
var password_with_revealed_suggestion = document.getElementById('password2');
if (!window.internals)
testFailed('This test requires internals object');
else {
password_with_masked_suggestion.focus();
password_with_revealed_suggestion.focus();
internals.setShouldRevealPassword(password_with_masked_suggestion, false);
internals.setSuggestedValue(password_with_masked_suggestion, 'suggested value');
internals.setShouldRevealPassword(password_with_revealed_suggestion, true);
internals.setSuggestedValue(password_with_revealed_suggestion, 'suggested value');
Markup.description(document.getElementById('description').textContent)
function addTextResult(value) { password_with_masked_suggestion.parentNode.appendChild(document.createTextNode(value + ': ' + eval(value))); }
addTextResult('password_with_masked_suggestion.value');
addTextResult('internals.suggestedValue(password_with_masked_suggestion)');
addTextResult('password_with_revealed_suggestion.value');
addTextResult('internals.suggestedValue(password_with_revealed_suggestion)');
Markup.dump(password_with_masked_suggestion.parentNode);
}
</script>
</body>
</html>