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..f410aa9e06cff186cf1d2930afdd386afc366039 |
--- /dev/null |
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/input/TextSuggestionMenuTest.java |
@@ -0,0 +1,51 @@ |
+// 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.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"); |
+ Thread.sleep(1000); |
Theresa
2017/07/20 00:50:33
I just noticed this test file (sorry!). What is th
rlanday
2017/07/20 01:39:20
This is to wait for the popup menu to show (there'
rlanday
2017/07/20 01:39:20
This is to wait for the popup menu to show (there'
|
+ |
+ View view = cvc.getTextSuggestionHostForTesting() |
+ .getSuggestionsPopupWindowForTesting() |
+ .getContentViewForTesting(); |
+ TouchCommon.singleClickView(view.findViewById(R.id.deleteButton)); |
+ Assert.assertEquals("", DOMUtils.getNodeContents(cvc.getWebContents(), "div")); |
+ } |
+} |