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

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

Issue 206353003: Revert of Show IME when DPAD_CENTER is pressed (https://codereview.chromium.org/161933002/) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Keeping the setImeAdapterForTest method Created 6 years, 9 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 | « content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/javatests/src/org/chromium/content/browser/ContentViewCoreDpadTest.java
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/ContentViewCoreDpadTest.java b/content/public/android/javatests/src/org/chromium/content/browser/ContentViewCoreDpadTest.java
deleted file mode 100644
index 0db99aa9c5e9d79c239189889a25eafeb15f0a9b..0000000000000000000000000000000000000000
--- a/content/public/android/javatests/src/org/chromium/content/browser/ContentViewCoreDpadTest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright 2014 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.content.browser;
-
-import android.content.Context;
-import android.test.suitebuilder.annotation.SmallTest;
-import android.view.KeyEvent;
-
-import org.chromium.content.browser.input.ImeAdapter;
-import org.chromium.content_shell_apk.ContentShellTestBase;
-
-/**
- * Tests that ContentViewCore responds to DPAD key events correctly
- */
-public class ContentViewCoreDpadTest extends ContentShellTestBase {
- TestContentViewCore mContentViewCore;
- private static class TestImeAdapter extends ImeAdapter {
- public TestImeAdapter() {
- super(null, null);
- }
-
- @Override
- public boolean dispatchKeyEvent(KeyEvent event) {
- return true;
- }
- }
-
- private static class TestContentViewCore extends ContentViewCore {
- private boolean mIsShowImeIfNeededCalled = false;
- public TestContentViewCore(Context context) {
- super(context);
- }
-
- public boolean isShowImeIfNeededCalled() {
- return mIsShowImeIfNeededCalled;
- }
-
- @Override
- public void showImeIfNeeded() {
- mIsShowImeIfNeededCalled = true;
- }
- }
-
- public void setUp() throws Exception {
- super.setUp();
- mContentViewCore = new TestContentViewCore(getActivity());
- mContentViewCore.setImeAdapterForTest(new TestImeAdapter());
- }
-
- @SmallTest
- // Test KEYCODE_DPAD_CENTER keyevent will bring up the IME, if needed
- public void testDpadCenterBringsUpIme() throws Exception {
- KeyEvent event = new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DPAD_CENTER);
-
- mContentViewCore.dispatchKeyEvent(event);
-
- // Just assert showImeIfNeeded is called. Software keyboard may not show if a QWERTY
- // keyboard is connected or if the focused object is not editable.
- assertTrue(mContentViewCore.isShowImeIfNeededCalled());
- }
-}
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698