OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.content.browser.input; | 5 package org.chromium.content.browser.input; |
6 | 6 |
7 import android.app.Activity; | 7 import android.app.Activity; |
8 import android.content.ClipData; | 8 import android.content.ClipData; |
9 import android.content.ClipboardManager; | 9 import android.content.ClipboardManager; |
10 import android.content.Context; | 10 import android.content.Context; |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
714 assertWaitForSelectActionBarStatus(false); | 714 assertWaitForSelectActionBarStatus(false); |
715 } | 715 } |
716 | 716 |
717 @SmallTest | 717 @SmallTest |
718 @Feature({"TextInput"}) | 718 @Feature({"TextInput"}) |
719 public void testSelectActionBarClearedOnTappingOutsideInput() throws Excepti on { | 719 public void testSelectActionBarClearedOnTappingOutsideInput() throws Excepti on { |
720 commitText("Sample Text", 1); | 720 commitText("Sample Text", 1); |
721 DOMUtils.longPressNode(this, mContentViewCore, "input_text"); | 721 DOMUtils.longPressNode(this, mContentViewCore, "input_text"); |
722 assertWaitForKeyboardStatus(true); | 722 assertWaitForKeyboardStatus(true); |
723 assertWaitForSelectActionBarStatus(true); | 723 assertWaitForSelectActionBarStatus(true); |
724 DOMUtils.clickNode(this, mContentViewCore, "input_radio"); | 724 DOMUtils.clickNode(this, mContentViewCore, "plain_text"); |
725 assertWaitForKeyboardStatus(false); | 725 assertWaitForKeyboardStatus(false); |
726 assertWaitForSelectActionBarStatus(false); | 726 assertWaitForSelectActionBarStatus(false); |
727 } | 727 } |
728 | 728 |
729 @SmallTest | 729 @SmallTest |
730 @Feature({"TextInput"}) | 730 @Feature({"TextInput"}) |
731 public void testImeNotShownOnLongPressingDifferentEmptyInputs() throws Excep tion { | 731 public void testImeNotShownOnLongPressingDifferentEmptyInputs() throws Excep tion { |
732 DOMUtils.focusNode(mWebContents, "input_radio"); | 732 DOMUtils.focusNode(mWebContents, "input_radio"); |
733 DOMUtils.longPressNode(this, mContentViewCore, "input_text"); | 733 DOMUtils.longPressNode(this, mContentViewCore, "input_text"); |
734 assertWaitForKeyboardStatus(false); | 734 assertWaitForKeyboardStatus(false); |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1248 public void testRestartInputKeepsTextAndCursor() throws Exception { | 1248 public void testRestartInputKeepsTextAndCursor() throws Exception { |
1249 commitText("ab", 2); | 1249 commitText("ab", 2); |
1250 restartInput(); | 1250 restartInput(); |
1251 assertEquals("ab", getTextBeforeCursor(10, 0)); | 1251 assertEquals("ab", getTextBeforeCursor(10, 0)); |
1252 } | 1252 } |
1253 | 1253 |
1254 @MediumTest | 1254 @MediumTest |
1255 @Feature({"TextInput"}) | 1255 @Feature({"TextInput"}) |
1256 public void testContentEditableEvents_ComposingText() throws Throwable { | 1256 public void testContentEditableEvents_ComposingText() throws Throwable { |
1257 focusElementAndWaitForStateUpdate("contenteditable_event"); | 1257 focusElementAndWaitForStateUpdate("contenteditable_event"); |
1258 waitForEventLogs("selectionchange,selectionchange"); | 1258 waitForEventLogs("selectionchange"); |
yosin_UTC9
2017/02/13 08:09:00
(^_^)b
| |
1259 clearEventLogs(); | 1259 clearEventLogs(); |
1260 | 1260 |
1261 setComposingText("a", 1); | 1261 setComposingText("a", 1); |
1262 waitAndVerifyUpdateSelection(0, 1, 1, 0, 1); | 1262 waitAndVerifyUpdateSelection(0, 1, 1, 0, 1); |
1263 // TODO(changwan): reduce the number of selection changes. | 1263 // TODO(changwan): reduce the number of selection changes. |
1264 waitForEventLogs("keydown(229),compositionstart(),compositionupdate(a),i nput,keyup(229)," | 1264 waitForEventLogs("keydown(229),compositionstart(),compositionupdate(a),i nput,keyup(229)," |
1265 + "selectionchange,selectionchange"); | 1265 + "selectionchange,selectionchange"); |
1266 clearEventLogs(); | 1266 clearEventLogs(); |
1267 | 1267 |
1268 finishComposingText(); | 1268 finishComposingText(); |
(...skipping 14 matching lines...) Expand all Loading... | |
1283 | 1283 |
1284 finishComposingText(); | 1284 finishComposingText(); |
1285 waitAndVerifyUpdateSelection(1, 1, 1, -1, -1); | 1285 waitAndVerifyUpdateSelection(1, 1, 1, -1, -1); |
1286 waitForEventLogs("compositionend(a)"); | 1286 waitForEventLogs("compositionend(a)"); |
1287 } | 1287 } |
1288 | 1288 |
1289 @MediumTest | 1289 @MediumTest |
1290 @Feature({"TextInput"}) | 1290 @Feature({"TextInput"}) |
1291 public void testContentEditableEvents_CommitText() throws Throwable { | 1291 public void testContentEditableEvents_CommitText() throws Throwable { |
1292 focusElementAndWaitForStateUpdate("contenteditable_event"); | 1292 focusElementAndWaitForStateUpdate("contenteditable_event"); |
1293 waitForEventLogs("selectionchange,selectionchange"); | 1293 waitForEventLogs("selectionchange"); |
1294 clearEventLogs(); | 1294 clearEventLogs(); |
1295 | 1295 |
1296 commitText("a", 1); | 1296 commitText("a", 1); |
1297 waitAndVerifyUpdateSelection(0, 1, 1, -1, -1); | 1297 waitAndVerifyUpdateSelection(0, 1, 1, -1, -1); |
1298 | 1298 |
1299 waitForEventLogs("keydown(229),input,keyup(229),selectionchange"); | 1299 waitForEventLogs("keydown(229),input,keyup(229),selectionchange"); |
1300 } | 1300 } |
1301 | 1301 |
1302 @MediumTest | 1302 @MediumTest |
1303 @Feature({"TextInput"}) | 1303 @Feature({"TextInput"}) |
1304 public void testInputTextEvents_CommitText() throws Throwable { | 1304 public void testInputTextEvents_CommitText() throws Throwable { |
1305 commitText("a", 1); | 1305 commitText("a", 1); |
1306 waitAndVerifyUpdateSelection(0, 1, 1, -1, -1); | 1306 waitAndVerifyUpdateSelection(0, 1, 1, -1, -1); |
1307 | 1307 |
1308 waitForEventLogs("keydown(229),input,keyup(229),selectionchange"); | 1308 waitForEventLogs("keydown(229),input,keyup(229),selectionchange"); |
1309 } | 1309 } |
1310 | 1310 |
1311 @MediumTest | 1311 @MediumTest |
1312 @Feature({"TextInput"}) | 1312 @Feature({"TextInput"}) |
1313 public void testContentEditableEvents_DeleteSurroundingText() throws Throwab le { | 1313 public void testContentEditableEvents_DeleteSurroundingText() throws Throwab le { |
1314 focusElementAndWaitForStateUpdate("contenteditable_event"); | 1314 focusElementAndWaitForStateUpdate("contenteditable_event"); |
1315 waitForEventLogs("selectionchange,selectionchange"); | 1315 waitForEventLogs("selectionchange"); |
1316 clearEventLogs(); | 1316 clearEventLogs(); |
1317 | 1317 |
1318 commitText("hello", 1); | 1318 commitText("hello", 1); |
1319 waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); | 1319 waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); |
1320 waitForEventLogs("keydown(229),input,keyup(229),selectionchange"); | 1320 waitForEventLogs("keydown(229),input,keyup(229),selectionchange"); |
1321 clearEventLogs(); | 1321 clearEventLogs(); |
1322 | 1322 |
1323 setSelection(2, 2); | 1323 setSelection(2, 2); |
1324 waitAndVerifyUpdateSelection(1, 2, 2, -1, -1); | 1324 waitAndVerifyUpdateSelection(1, 2, 2, -1, -1); |
1325 waitForEventLogs("selectionchange"); | 1325 waitForEventLogs("selectionchange"); |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1859 public void onViewAttachedToWindow() { | 1859 public void onViewAttachedToWindow() { |
1860 mFactory.onViewAttachedToWindow(); | 1860 mFactory.onViewAttachedToWindow(); |
1861 } | 1861 } |
1862 | 1862 |
1863 @Override | 1863 @Override |
1864 public void onViewDetachedFromWindow() { | 1864 public void onViewDetachedFromWindow() { |
1865 mFactory.onViewDetachedFromWindow(); | 1865 mFactory.onViewDetachedFromWindow(); |
1866 } | 1866 } |
1867 } | 1867 } |
1868 } | 1868 } |
OLD | NEW |