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

Unified Diff: content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java

Issue 1865143003: DO NOT SUBMIT: Handle nested message correctly for OnRequestTextInputState() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | content/renderer/render_widget.cc » ('j') | content/renderer/render_widget.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java b/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java
index d8c1eafd3d0bd5bfcd57611609f6201e431798f5..d06a2e46bd51b41dd73affbffa3cb39e37472109 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java
@@ -27,6 +27,7 @@ import org.chromium.content.browser.ContentViewCore;
import org.chromium.content.browser.test.util.Criteria;
import org.chromium.content.browser.test.util.CriteriaHelper;
import org.chromium.content.browser.test.util.DOMUtils;
+import org.chromium.content.browser.test.util.JavaScriptUtils;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
import org.chromium.content.browser.test.util.TestInputMethodManagerWrapper;
import org.chromium.content_public.browser.WebContents;
@@ -1047,6 +1048,22 @@ public class ImeTest extends ContentShellTestBase {
assertEquals("ab", getTextBeforeCursor(10, 0));
}
+ @MediumTest
+ @Feature({"TextInput"})
+ public void testAlertInKeyUpListenerDoesNotCrash() throws Exception {
+ // Call 'alert()' when 'keyup' event occurs. Since we are in contentshell,
+ // this does not actually pops up the alert window.
+ String code = "(function() { "
+ + "var editor = document.getElementById('input_text');"
+ + "editor.addEventListener('keyup', function(e) { alert('keyup') });"
+ + "})();";
+ JavaScriptUtils.executeJavaScriptAndWaitForResult(
+ getContentViewCore().getWebContents(), code);
+ setComposingText("ab", 1);
+ finishComposingText();
+ assertEquals("ab", getTextBeforeCursor(10, 0));
+ }
+
private void performGo(TestCallbackHelperContainer testCallbackHelperContainer)
throws Throwable {
final InputConnection inputConnection = mConnection;
« no previous file with comments | « no previous file | content/renderer/render_widget.cc » ('j') | content/renderer/render_widget.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698