Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 package org.chromium.chrome.browser.input; | |
| 6 | |
| 7 import android.support.test.filters.LargeTest; | |
| 8 import android.view.View; | |
| 9 | |
| 10 import org.junit.Assert; | |
| 11 | |
| 12 import org.chromium.chrome.browser.ChromeActivity; | |
| 13 import org.chromium.chrome.test.ChromeActivityTestCaseBase; | |
| 14 import org.chromium.content.R; | |
| 15 import org.chromium.content.browser.ContentViewCore; | |
| 16 import org.chromium.content.browser.test.util.DOMUtils; | |
| 17 import org.chromium.content.browser.test.util.TouchCommon; | |
| 18 | |
| 19 import java.util.concurrent.TimeoutException; | |
| 20 | |
| 21 /** | |
| 22 * Integration tests for the text suggestion menu. | |
| 23 */ | |
| 24 public class TextSuggestionMenuTest extends ChromeActivityTestCaseBase<ChromeAct ivity> { | |
| 25 private static final String URL = | |
| 26 "data:text/html, <div contenteditable id=\"div\">iuvwneaoanls</div>" ; | |
| 27 | |
| 28 public TextSuggestionMenuTest() { | |
| 29 super(ChromeActivity.class); | |
| 30 } | |
| 31 | |
| 32 @Override | |
| 33 public void startMainActivity() throws InterruptedException { | |
| 34 startMainActivityOnBlankPage(); | |
| 35 } | |
| 36 | |
| 37 @LargeTest | |
| 38 public void testDeleteMisspelledWord() throws InterruptedException, TimeoutE xception { | |
| 39 loadUrl(URL); | |
| 40 final ContentViewCore cvc = getActivity().getActivityTab().getContentVie wCore(); | |
| 41 DOMUtils.focusNode(cvc.getWebContents(), "div"); | |
| 42 DOMUtils.clickNode(cvc, "div"); | |
| 43 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'
| |
| 44 | |
| 45 View view = cvc.getTextSuggestionHostForTesting() | |
| 46 .getSuggestionsPopupWindowForTesting() | |
| 47 .getContentViewForTesting(); | |
| 48 TouchCommon.singleClickView(view.findViewById(R.id.deleteButton)); | |
| 49 Assert.assertEquals("", DOMUtils.getNodeContents(cvc.getWebContents(), " div")); | |
| 50 } | |
| 51 } | |
| OLD | NEW |