Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Unified Diff: LayoutTests/fast/forms/input-autofilled.html

Issue 214693004: Add Layout test to check <select> with -webkit-autofil style (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/forms/input-autofilled-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/forms/input-autofilled.html
diff --git a/LayoutTests/fast/forms/input-autofilled.html b/LayoutTests/fast/forms/input-autofilled.html
index e7f8aacfde47583c9b064bc030df51011bc48e89..b0543e23a7ffd8116b7b8338def20d93f33a777b 100644
--- a/LayoutTests/fast/forms/input-autofilled.html
+++ b/LayoutTests/fast/forms/input-autofilled.html
@@ -13,9 +13,11 @@
var field = document.getElementById('field');
var textarea = document.getElementById('textarea');
+ var select = document.getElementById('select');
var computedStyleField = document.defaultView.getComputedStyle(field);
var computedStyleTextarea = document.defaultView.getComputedStyle(textarea);
+ var computedStyleSelect = document.defaultView.getComputedStyle(select);
var originalForeground = computedStyleField.color;
var originalBackground = computedStyleField.backgroundColor;
@@ -31,11 +33,13 @@
if (window.internals) {
window.internals.setAutofilled(field, true);
window.internals.setAutofilled(textarea, true);
+ window.internals.setAutofilled(select, true);
}
// Both the foreground and background colors should change.
computedStyleField = document.defaultView.getComputedStyle(field);
computedStyleTextarea = document.defaultView.getComputedStyle(textarea);
+ computedStyleSelect = document.defaultView.getComputedStyle(select);
if (computedStyleField.color == originalForeground) {
testFailed('Foreground color for <input> element did not change when autofilled.');
return;
@@ -52,15 +56,25 @@
testFailed('Background color for <textarea> element did not change when autofilled.');
return;
}
+ if (computedStyleSelect.color == originalForeground) {
+ testFailed('Foreground color for <select> element did not change when autofilled.');
+ return;
+ }
+ if (computedStyleSelect.backgroundColor == originalBackground) {
+ testFailed('Background color for <select> element did not change when autofilled.');
+ return;
+ }
if (window.internals) {
window.internals.setAutofilled(field, false);
window.internals.setAutofilled(textarea, false);
+ window.internals.setAutofilled(select, false);
}
// Colors should be restored.
computedStyleField = document.defaultView.getComputedStyle(field);
computedStyleTextarea = document.defaultView.getComputedStyle(textarea);
+ computedStyleSelect = document.defaultView.getComputedStyle(select);
if (computedStyleField.color != originalForeground) {
testFailed('Foreground color for <input> element did not revert when un-autofilled.');
return;
@@ -77,23 +91,32 @@
testFailed('Background color for <textarea> element did not revert when un-autofilled.');
return;
}
+ if (computedStyleSelect.color != originalForeground) {
+ testFailed('Foreground color for <select> element did not revert when un-autofilled.');
+ return;
+ }
+ if (computedStyleSelect.backgroundColor != originalBackground) {
+ testFailed('Background color for <select> element did not revert when un-autofilled.');
+ return;
+ }
testPassed('');
}
</script>
<style>
- #field, #textarea {
+ #field, #textarea, #select {
color: #FFFFFF;
background-color: #FFFFFF;
}
</style>
</head>
<body onload="test()">
- This tests that foreground and background colors properly change for autofilled inputs. It can only be run using the test harness.<br>
+ This tests that foreground and background colors properly change for autofilled inputs or select options. It can only be run using the test harness.<br>
<form name="fm">
<input type="text" id="field" value="Field value">
<textarea id="textarea"></textarea>
+ <select id="select"></select>
</form>
<div id="console"></div>
</body>
« no previous file with comments | « no previous file | LayoutTests/fast/forms/input-autofilled-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698