Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / forms / autofilled.html
index 2d667cf..ee322fc 100644 (file)
@@ -30,6 +30,7 @@ function test() {
     textarea2.value = 'autofilled is true';
     var select1 = document.getElementById('select1');
     select2 = document.getElementById('select2');
+    var select3 = document.getElementById('select3');
 
     shouldBe('foregroundOf(textarea1)', 'originalForeground');
     shouldBe('backgroundOf(textarea1)', 'originalBackground');
@@ -40,6 +41,7 @@ function test() {
     window.internals.setAutofilled(textarea2, true);
     window.internals.setAutofilled(select1, true);
     window.internals.setAutofilled(select2, true);
+    window.internals.setAutofilled(select3, true);
 
     shouldBeEqualToString('search.value', 'Search value');
 
@@ -56,6 +58,8 @@ function test() {
     shouldNotBe('backgroundOf(select1)', 'originalBackground');
     shouldNotBe('foregroundOf(select2)', 'originalForeground');
     shouldNotBe('backgroundOf(select2)', 'originalBackground');
+    shouldNotBe('foregroundOf(select3)', 'originalForeground');
+    shouldNotBe('backgroundOf(select3)', 'originalBackground');
 
     // Remove an unselected option from <select> element. This should not affect the background color for the autofilled <select> element.
     shouldBe('select2.options.length', '3');
@@ -88,6 +92,9 @@ function test() {
     // Remove selected option for select2 element
     select2.removeChild(select2[select2.selectedIndex]);
 
+    // Change selected option for select3 element
+    select3.selectedIndex = 2;
+
     // Colors should be restored.
     shouldBe('foregroundOf(field)', 'originalForeground');
     shouldBe('backgroundOf(field)', 'originalBackground');
@@ -101,11 +108,13 @@ function test() {
     shouldBe('backgroundOf(select1)', 'originalBackground');
     shouldBe('foregroundOf(select2)', 'originalForeground');
     shouldBe('backgroundOf(select2)', 'originalBackground');
+    shouldBe('foregroundOf(select3)', 'originalForeground');
+    shouldBe('backgroundOf(select3)', 'originalBackground');
 }
 </script>
 
 <style>
-#field, #search, #textarea1, #textarea2, #select1, #select2 {
+#field, #search, #textarea1, #textarea2, #select1, #select2, #select3 {
     color: #FFFFFF;
     background-color: #FFFFFF;
 }
@@ -124,6 +133,11 @@ function test() {
             <option >2</option>
             <option>3</option>
         </select>
+        <select id="select3">
+            <option selected>1</option>
+            <option >2</option>
+            <option>3</option>
+        </select>
     </form>
     <div id="console"></div>
 </body>