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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/input/TextSuggestionMenuTest.java

Issue 2931443003: Add support for Android spellcheck menu in Chrome/WebViews (Closed)
Patch Set: Simplify Mojo binding based on rockot@'s advice Created 3 years, 5 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 | « chrome/android/java_sources.gni ('k') | chrome/browser/chrome_content_browser_manifest_overlay.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/javatests/src/org/chromium/chrome/browser/input/TextSuggestionMenuTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/input/TextSuggestionMenuTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/input/TextSuggestionMenuTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..f3db74c2b3c39156ce0f5b8ffba5483a75f2c7b6
--- /dev/null
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/input/TextSuggestionMenuTest.java
@@ -0,0 +1,61 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.input;
+
+import android.support.test.filters.LargeTest;
+import android.view.View;
+
+import org.junit.Assert;
+
+import org.chromium.chrome.browser.ChromeActivity;
+import org.chromium.chrome.test.ChromeActivityTestCaseBase;
+import org.chromium.content.R;
+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.TouchCommon;
+
+import java.util.concurrent.TimeoutException;
+
+/**
+ * Integration tests for the text suggestion menu.
+ */
+public class TextSuggestionMenuTest extends ChromeActivityTestCaseBase<ChromeActivity> {
+ private static final String URL =
+ "data:text/html, <div contenteditable id=\"div\">iuvwneaoanls</div>";
+
+ public TextSuggestionMenuTest() {
+ super(ChromeActivity.class);
+ }
+
+ @Override
+ public void startMainActivity() throws InterruptedException {
+ startMainActivityOnBlankPage();
+ }
+
+ @LargeTest
+ public void testDeleteMisspelledWord() throws InterruptedException, TimeoutException {
+ loadUrl(URL);
+ final ContentViewCore cvc = getActivity().getActivityTab().getContentViewCore();
+ DOMUtils.focusNode(cvc.getWebContents(), "div");
+ DOMUtils.clickNode(cvc, "div");
+
+ // Wait for the suggestion menu to show
+ CriteriaHelper.pollUiThread(new Criteria() {
+ @Override
+ public boolean isSatisfied() {
+ return cvc.getTextSuggestionHostForTesting().getSuggestionsPopupWindowForTesting()
+ != null;
+ }
+ });
+
+ View view = cvc.getTextSuggestionHostForTesting()
+ .getSuggestionsPopupWindowForTesting()
+ .getContentViewForTesting();
+ TouchCommon.singleClickView(view.findViewById(R.id.deleteButton));
+ Assert.assertEquals("", DOMUtils.getNodeContents(cvc.getWebContents(), "div"));
+ }
+}
« no previous file with comments | « chrome/android/java_sources.gni ('k') | chrome/browser/chrome_content_browser_manifest_overlay.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698