Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a9c1127 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Fix test failures due to unexpected overload resolution

Starting with Ie04e8a27050849fee1c93ef14b9944acc70fafe4,
CursorAnchorInfo#getComposingText() returns CharSequence rather
than String.  This causes unexpected overload resolution,
which results in test failures.

BUG: 15088391
Change-Id: I51e2b23573e92be7e5b1dcca6402e85364408215
parent 499f7e87
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -20,6 +20,7 @@ import android.graphics.Matrix;
import android.graphics.RectF;
import android.graphics.RectF;
import android.test.InstrumentationTestCase;
import android.test.InstrumentationTestCase;
import android.test.suitebuilder.annotation.SmallTest;
import android.test.suitebuilder.annotation.SmallTest;
import android.text.TextUtils;
import android.view.inputmethod.CursorAnchorInfo;
import android.view.inputmethod.CursorAnchorInfo;
import android.view.inputmethod.CursorAnchorInfo.Builder;
import android.view.inputmethod.CursorAnchorInfo.Builder;


@@ -81,7 +82,7 @@ public class CursorAnchorInfoTest extends InstrumentationTestCase {
        assertEquals(SELECTION_START, info.getSelectionStart());
        assertEquals(SELECTION_START, info.getSelectionStart());
        assertEquals(SELECTION_END, info.getSelectionEnd());
        assertEquals(SELECTION_END, info.getSelectionEnd());
        assertEquals(COMPOSING_TEXT_START, info.getComposingTextStart());
        assertEquals(COMPOSING_TEXT_START, info.getComposingTextStart());
        assertEquals(COMPOSING_TEXT, info.getComposingText());
        assertTrue(TextUtils.equals(COMPOSING_TEXT, info.getComposingText()));
        assertEquals(INSERTION_MARKER_HORIZONTAL, info.getInsertionMarkerHorizontal());
        assertEquals(INSERTION_MARKER_HORIZONTAL, info.getInsertionMarkerHorizontal());
        assertEquals(INSERTION_MARKER_TOP, info.getInsertionMarkerTop());
        assertEquals(INSERTION_MARKER_TOP, info.getInsertionMarkerTop());
        assertEquals(INSERTION_MARKER_BASELINE, info.getInsertionMarkerBaseline());
        assertEquals(INSERTION_MARKER_BASELINE, info.getInsertionMarkerBaseline());
@@ -97,7 +98,7 @@ public class CursorAnchorInfoTest extends InstrumentationTestCase {
        assertEquals(SELECTION_START, info2.getSelectionStart());
        assertEquals(SELECTION_START, info2.getSelectionStart());
        assertEquals(SELECTION_END, info2.getSelectionEnd());
        assertEquals(SELECTION_END, info2.getSelectionEnd());
        assertEquals(COMPOSING_TEXT_START, info2.getComposingTextStart());
        assertEquals(COMPOSING_TEXT_START, info2.getComposingTextStart());
        assertEquals(COMPOSING_TEXT, info2.getComposingText());
        assertTrue(TextUtils.equals(COMPOSING_TEXT, info2.getComposingText()));
        assertEquals(INSERTION_MARKER_HORIZONTAL, info2.getInsertionMarkerHorizontal());
        assertEquals(INSERTION_MARKER_HORIZONTAL, info2.getInsertionMarkerHorizontal());
        assertEquals(INSERTION_MARKER_TOP, info2.getInsertionMarkerTop());
        assertEquals(INSERTION_MARKER_TOP, info2.getInsertionMarkerTop());
        assertEquals(INSERTION_MARKER_BASELINE, info2.getInsertionMarkerBaseline());
        assertEquals(INSERTION_MARKER_BASELINE, info2.getInsertionMarkerBaseline());
@@ -110,12 +111,12 @@ public class CursorAnchorInfoTest extends InstrumentationTestCase {
        assertEquals(info, info2);
        assertEquals(info, info2);
        assertEquals(info.hashCode(), info2.hashCode());
        assertEquals(info.hashCode(), info2.hashCode());


        // Make sure that object can be marshalled via {@link Parsel}.
        // Make sure that object can be marshaled via {@link Parsel}.
        final CursorAnchorInfo info3 = cloneViaParcel(info2);
        final CursorAnchorInfo info3 = cloneViaParcel(info2);
        assertEquals(SELECTION_START, info3.getSelectionStart());
        assertEquals(SELECTION_START, info3.getSelectionStart());
        assertEquals(SELECTION_END, info3.getSelectionEnd());
        assertEquals(SELECTION_END, info3.getSelectionEnd());
        assertEquals(COMPOSING_TEXT_START, info3.getComposingTextStart());
        assertEquals(COMPOSING_TEXT_START, info3.getComposingTextStart());
        assertEquals(COMPOSING_TEXT, info3.getComposingText());
        assertTrue(TextUtils.equals(COMPOSING_TEXT, info3.getComposingText()));
        assertEquals(INSERTION_MARKER_HORIZONTAL, info3.getInsertionMarkerHorizontal());
        assertEquals(INSERTION_MARKER_HORIZONTAL, info3.getInsertionMarkerHorizontal());
        assertEquals(INSERTION_MARKER_TOP, info3.getInsertionMarkerTop());
        assertEquals(INSERTION_MARKER_TOP, info3.getInsertionMarkerTop());
        assertEquals(INSERTION_MARKER_BASELINE, info3.getInsertionMarkerBaseline());
        assertEquals(INSERTION_MARKER_BASELINE, info3.getInsertionMarkerBaseline());