iOS: inputmode="none" disables hardware keyboard's globe key
[WebKit-https.git] / LayoutTests / fast / forms / ios / inputmode-none.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta name="viewport" content="width=device-width, initial-scale=1">
5 <script src="../../../resources/js-test.js"></script>
6 <script src="../../../resources/ui-helper.js"></script>
7 </head>
8 <body onload="runTest()">
9 <input id="input-keyboard" inputmode="text">
10 <input id="input-nokeyboard" inputmode="none">
11 <script>
12 jsTestIsAsync = true;
13
14 async function runTest() {
15     inputWithSystemKeyboard = document.getElementById("input-keyboard");
16     inputWithoutSystemKeyboard = document.getElementById("input-nokeyboard");
17
18     description('This test verifies that the system keyboard is not visible when tapping on an input field with inputmode=none.');
19
20     debug('\nACTIVATE input with inputmode=text');
21     await UIHelper.activateFormControl(inputWithSystemKeyboard);
22     systemKeyboardRect = await UIHelper.inputViewBounds();
23     shouldBe('textKeyboardHeight = systemKeyboardRect.height; systemKeyboardRect.height > 0', 'true');
24     await UIHelper.enterText("Text");
25     shouldBe('inputWithSystemKeyboard.value', '"Text"');
26
27     debug('\nACTIVATE input with inputmode=none');
28     await UIHelper.activateFormControl(inputWithoutSystemKeyboard);
29     systemKeyboardRect = await UIHelper.inputViewBounds();
30     shouldBe('systemKeyboardRect.height', 'textKeyboardHeight');
31
32     debug('\nTEST enter text in input with inputmode=none');
33     await UIHelper.enterText("None");
34     shouldBe('inputWithoutSystemKeyboard.value', '"None"');
35
36     debug('\nTEST selection in input with inputmode=none');
37     inputWithoutSystemKeyboard.setSelectionRange(0, inputWithSystemKeyboard.value.length);
38     selectionRects = await UIHelper.getUISelectionRects();
39     shouldBe('selectionRects.length', '1');
40     shouldBe('selectionRects[0].left', '159');
41     shouldBe('selectionRects[0].top', '261');
42     shouldBe('selectionRects[0].width', '28');
43     shouldBe('selectionRects[0].height', '15');
44
45     debug('');
46     finishJSTest();
47 }
48 </script>
49 </body>
50 </html>