| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.content.browser.input; | 5 package org.chromium.content.browser.input; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.os.IBinder; | 8 import android.os.IBinder; |
| 9 import android.os.ResultReceiver; | 9 import android.os.ResultReceiver; |
| 10 import android.test.suitebuilder.annotation.MediumTest; | 10 import android.test.suitebuilder.annotation.MediumTest; |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 state.compositionStart); | 224 state.compositionStart); |
| 225 assertEquals("Composition end did not match", compositionEnd, state.
compositionEnd); | 225 assertEquals("Composition end did not match", compositionEnd, state.
compositionEnd); |
| 226 } | 226 } |
| 227 } | 227 } |
| 228 | 228 |
| 229 private static class TestImeAdapterDelegate implements ImeAdapterDelegate { | 229 private static class TestImeAdapterDelegate implements ImeAdapterDelegate { |
| 230 @Override | 230 @Override |
| 231 public void onImeEvent() {} | 231 public void onImeEvent() {} |
| 232 | 232 |
| 233 @Override | 233 @Override |
| 234 public void onDismissInput() {} | |
| 235 | |
| 236 @Override | |
| 237 public void onKeyboardBoundsUnchanged() {} | 234 public void onKeyboardBoundsUnchanged() {} |
| 238 | 235 |
| 239 @Override | 236 @Override |
| 240 public boolean performContextMenuAction(int id) { | 237 public boolean performContextMenuAction(int id) { |
| 241 return false; | 238 return false; |
| 242 } | 239 } |
| 243 | 240 |
| 244 @Override | 241 @Override |
| 245 public View getAttachedView() { | 242 public View getAttachedView() { |
| 246 return null; | 243 return null; |
| 247 } | 244 } |
| 248 | 245 |
| 249 @Override | 246 @Override |
| 250 public ResultReceiver getNewShowKeyboardReceiver() { | 247 public ResultReceiver getNewShowKeyboardReceiver() { |
| 251 return null; | 248 return null; |
| 252 } | 249 } |
| 253 } | 250 } |
| 254 | 251 |
| 255 private static void assertCorrectState(String text, int selectionStart, int
selectionEnd, | 252 private static void assertCorrectState(String text, int selectionStart, int
selectionEnd, |
| 256 int compositionStart, int compositionEnd, ImeState actual) { | 253 int compositionStart, int compositionEnd, ImeState actual) { |
| 257 assertEquals("Text did not match", text, actual.text); | 254 assertEquals("Text did not match", text, actual.text); |
| 258 assertEquals("Selection start did not match", selectionStart, actual.sel
ectionStart); | 255 assertEquals("Selection start did not match", selectionStart, actual.sel
ectionStart); |
| 259 assertEquals("Selection end did not match", selectionEnd, actual.selecti
onEnd); | 256 assertEquals("Selection end did not match", selectionEnd, actual.selecti
onEnd); |
| 260 assertEquals("Composition start did not match", compositionStart, actual
.compositionStart); | 257 assertEquals("Composition start did not match", compositionStart, actual
.compositionStart); |
| 261 assertEquals("Composition end did not match", compositionEnd, actual.com
positionEnd); | 258 assertEquals("Composition end did not match", compositionEnd, actual.com
positionEnd); |
| 262 } | 259 } |
| 263 } | 260 } |
| OLD | NEW |