4 function focusElementAndPressTabKey(el)
7 if (window.eventSender)
8 eventSender.keyDown("\t");
13 if (window.testRunner)
14 testRunner.dumpAsText();
16 var el = document.getElementById('ta');
18 // Test that default setting is to cycle through elements.
19 // This tab key press should not insert a tab.
20 focusElementAndPressTabKey(el);
24 if (window.testRunner)
25 testRunner.setTabKeyCyclesThroughElements(false);
27 // Test that activating the setting causes a tab character insertion.
28 focusElementAndPressTabKey(el);
32 // Set this preference so the tab key will actually insert a tab character- like in Mail.
33 if (window.testRunner)
34 testRunner.setTabKeyCyclesThroughElements(true);
36 // Test that deactivating the setting prevents a tab insertion.
38 focusElementAndPressTabKey(el);
42 res.innerHTML = "Test Passed";
47 <body onload="test()">
48 This tests that you can insert a tab in a WebKit app that allows tab insertion<br>
49 <textarea id="ta"></textarea><br>
50 <div id="res">Test Failed</div>