Home
last modified time | relevance | path

Searched refs:span (Results 1 – 25 of 31) sorted by relevance

12

/cts/tests/tests/text/src/android/text/style/cts/
DQuoteSpanTest.java39 QuoteSpan span = new QuoteSpan(); in testDefaultConstructor() local
40 assertEquals(calculateLeadingMargin(span.getStripeWidth(), span.getGapWidth()), in testDefaultConstructor()
41 span.getLeadingMargin(true)); in testDefaultConstructor()
42 assertTrue(span.getColor() != 0); in testDefaultConstructor()
43 assertTrue(span.getGapWidth() > 0); in testDefaultConstructor()
44 assertTrue(span.getStripeWidth() > 0); in testDefaultConstructor()
49 QuoteSpan span = new QuoteSpan(Color.RED); in testConstructorFromColor() local
50 assertEquals(calculateLeadingMargin(span.getStripeWidth(), span.getGapWidth()), in testConstructorFromColor()
51 span.getLeadingMargin(true)); in testConstructorFromColor()
52 assertEquals(Color.RED, span.getColor()); in testConstructorFromColor()
[all …]
DSuggestionSpanTest.java61 final SuggestionSpan span = new SuggestionSpan(context, suggestions, in testConstructorWithContext() local
64 assertEquals(locale, span.getLocaleObject()); in testConstructorWithContext()
65 assertArrayEquals(suggestions, span.getSuggestions()); in testConstructorWithContext()
66 assertEquals(SuggestionSpan.FLAG_AUTO_CORRECTION, span.getFlags()); in testConstructorWithContext()
72 final SuggestionSpan span = new SuggestionSpan(Locale.forLanguageTag("en"), suggestions, in testGetSuggestionSpans() local
75 suggestions, span.getSuggestions()); in testGetSuggestionSpans()
77 final SuggestionSpan clonedSpan = cloneViaParcel(span); in testGetSuggestionSpans()
85 final SuggestionSpan span = new SuggestionSpan(Locale.forLanguageTag("en"), suggestions, in testGetSuggestionSpans_emptySuggestions() local
88 suggestions, span.getSuggestions()); in testGetSuggestionSpans_emptySuggestions()
91 final SuggestionSpan clonedSpan = cloneViaParcel(span); in testGetSuggestionSpans_emptySuggestions()
[all …]
DSuggestionRangeSpanTest.java39 final SuggestionRangeSpan span = new SuggestionRangeSpan(); in testConstructor() local
40 assertEquals(0, span.getBackgroundColor()); in testConstructor()
64 final SuggestionRangeSpan span = new SuggestionRangeSpan(); in testSetAndGetBackgroundColor() local
65 assertEquals(0, span.getBackgroundColor()); in testSetAndGetBackgroundColor()
67 span.setBackgroundColor(1); in testSetAndGetBackgroundColor()
68 assertEquals(1, span.getBackgroundColor()); in testSetAndGetBackgroundColor()
73 final SuggestionRangeSpan span = new SuggestionRangeSpan(); in testUpdateDrawState() local
74 span.setBackgroundColor(1); in testUpdateDrawState()
76 span.updateDrawState(tp); in testUpdateDrawState()
DLineHeightSpan_StandardTest.java53 LineHeightSpan span = new LineHeightSpan.Standard(expectHeight); in testChooseLineHeight() local
58 span.chooseHeight("helloworld", 0, 9, 0, fm.descent - fm.ascent, fm); in testChooseLineHeight()
63 span.chooseHeight("helloworld", 0, 9, 0, fm.descent - fm.ascent, fm); in testChooseLineHeight()
72 LineHeightSpan span = new LineHeightSpan.Standard(50); in testChooseLineHeightWithNegativeOriginHeight() local
77 span.chooseHeight("helloworld", 0, 9, 0, fm.descent - fm.ascent, fm); in testChooseLineHeightWithNegativeOriginHeight()
85 LineHeightSpan.Standard span = new LineHeightSpan.Standard(height); in testGetHeight() local
87 assertEquals(height, span.getHeight()); in testGetHeight()
92 final LineHeightSpan.Standard span = new LineHeightSpan.Standard(20); in testWriteToParcel() local
94 span.writeToParcel(parcel, 0); in testWriteToParcel()
98 assertEquals(span.getHeight(), parcelSpan.getHeight()); in testWriteToParcel()
[all …]
DTextAppearanceSpanTest.java314 final TextAppearanceSpan span = new TextAppearanceSpan(mContext, in testCreateFromStyle_FontResource() local
318 span.updateDrawState(tp); in testCreateFromStyle_FontResource()
324 final TextAppearanceSpan span = new TextAppearanceSpan(mContext, in testCreateFromStyle_ElegantTextHeight() local
327 span.updateDrawState(tp); in testCreateFromStyle_ElegantTextHeight()
333 final TextAppearanceSpan span = new TextAppearanceSpan(mContext, in testCreateFromStyle_LetterSpacing() local
336 span.updateDrawState(tp); in testCreateFromStyle_LetterSpacing()
342 final TextAppearanceSpan span = new TextAppearanceSpan(mContext, in testCreateFromStyle_FontFeatureSettings() local
345 span.updateDrawState(tp); in testCreateFromStyle_FontFeatureSettings()
351 final TextAppearanceSpan span = new TextAppearanceSpan(mContext, in testCreateFromStyle_FontVariationSettings() local
354 span.updateDrawState(tp); in testCreateFromStyle_FontVariationSettings()
[all …]
DLineBackgroundSpan_StandardTest.java42 final LineBackgroundSpan.Standard span = new LineBackgroundSpan.Standard(COLOR); in testGetColor() local
43 assertEquals(COLOR, span.getColor()); in testGetColor()
49 final LineBackgroundSpan.Standard span = new LineBackgroundSpan.Standard(COLOR); in testWriteToParcel() local
52 span.writeToParcel(p, 0); in testWriteToParcel()
56 assertEquals(span.getSpanTypeId(), parcelSpan.getSpanTypeId()); in testWriteToParcel()
64 final LineBackgroundSpan span = new LineBackgroundSpan.Standard(COLOR); in testDrawBackground() local
75 span.drawBackground(canvas, paint, left, right, top, baseline, bottom, in testDrawBackground()
DLineBreakConfigSpanTest.kt123 val span = LineBreakConfigSpan(config) in testLineBreakConfigSpan_getSpanTypeId() constant
126 span.getSpanTypeId() in testLineBreakConfigSpan_getSpanTypeId()
427 private fun assertNoBreakSpan(span: LineBreakConfigSpan) { in assertNoBreakSpan()
428 val config = span.lineBreakConfig in assertNoBreakSpan()
435 private fun assertNoHyphenationSpan(span: LineBreakConfigSpan) { in assertNoHyphenationSpan()
436 val config = span.lineBreakConfig in assertNoHyphenationSpan()
479 var span = spans[0] in testLineBreakConfigSpan_parcelable() variable
480 assertNoBreakSpan(span) in testLineBreakConfigSpan_parcelable()
484 span = spans[0] in testLineBreakConfigSpan_parcelable()
485 assertNoHyphenationSpan(span) in testLineBreakConfigSpan_parcelable()
[all …]
DLocaleSpanTest.java38 final LocaleSpan span = new LocaleSpan(locales); in verifyGetLocales() local
39 assertEquals(locales.get(0), span.getLocale()); in verifyGetLocales()
40 assertEquals(locales, span.getLocales()); in verifyGetLocales()
42 final LocaleSpan cloned = cloneViaParcel(span); in verifyGetLocales()
DIconMarginSpanTest.java56 IconMarginSpan span = new IconMarginSpan(BITMAP_80X120, 32); in testConstructAndGet() local
57 assertEquals(BITMAP_80X120, span.getBitmap()); in testConstructAndGet()
58 assertEquals(32, span.getPadding()); in testConstructAndGet()
DDrawableMarginSpanTest.java65 DrawableMarginSpan span = new DrawableMarginSpan(mDrawable, 32); in testConstructAndGet() local
66 assertEquals(mDrawable, span.getDrawable()); in testConstructAndGet()
67 assertEquals(32, span.getPadding()); in testConstructAndGet()
DTtsSpanTest.java65 TtsSpan span = new TtsSpan("test.type.three", mBundle); in testDescribeContents() local
66 span.describeContents(); in testDescribeContents()
71 TtsSpan span = new TtsSpan("test.type.four", mBundle); in testGetSpanTypeId() local
72 span.getSpanTypeId(); in testGetSpanTypeId()
79 TtsSpan span = new TtsSpan("test.type.five", mBundle); in testWriteAndReadParcel() local
80 span.writeToParcel(p, 0); in testWriteAndReadParcel()
/cts/tests/tests/text/src/android/text/cts/
DSpannableStringBuilderSpanTest.java147 Object span = mSpanSet.mSpans[count]; in verifySpanPositions() local
150 int start = spannable.getSpanStart(span); in verifySpanPositions()
151 int end = spannable.getSpanEnd(span); in verifySpanPositions()
171 mSpanSet.mRecorder.verifyRemoved(span, originalStart, originalEnd); in verifySpanPositions()
244 mSpanSet.mRecorder.verifyChanged(span, originalStart, originalEnd, start, end); in verifySpanPositions()
246 mSpanSet.mRecorder.verifyUnmodified(span); in verifySpanPositions()
261 Object span = mReplacementSpanSet.mSpans[count]; in verifyReplacementSpanPositions() local
264 int start = originalSpannable.getSpanStart(span); in verifyReplacementSpanPositions()
265 int end = originalSpannable.getSpanEnd(span); in verifyReplacementSpanPositions()
274 mReplacementSpanSet.mRecorder.verifyUnmodified(span); in verifyReplacementSpanPositions()
[all …]
DInputFilter_AllCapsTest.java118 final Object span = new Object(); in testFilter_greekWithSpans() local
119 source.setSpan(span, 0, 2, Spanned.SPAN_INCLUSIVE_INCLUSIVE); // around "ί" in testFilter_greekWithSpans()
131 assertSame(span, resultSpans[0]); in testFilter_greekWithSpans()
132 assertEquals(0, spannedResult.getSpanStart(span)); in testFilter_greekWithSpans()
134 assertEquals(1, spannedResult.getSpanEnd(span)); in testFilter_greekWithSpans()
135 assertEquals(Spanned.SPAN_INCLUSIVE_INCLUSIVE, spannedResult.getSpanFlags(span)); in testFilter_greekWithSpans()
DLayoutDrawOrderTest.java171 LineBackgroundSpan span = mock(LineBackgroundSpan.class); in testStaticLayout_testDrawOrder_Highlight_on_top_of_Background() local
172 ss.setSpan(span, 4, 8, Spanned.SPAN_INCLUSIVE_EXCLUSIVE); in testStaticLayout_testDrawOrder_Highlight_on_top_of_Background()
180 InOrder order = inOrder(canvas, span); in testStaticLayout_testDrawOrder_Highlight_on_top_of_Background()
181 order.verify(span) in testStaticLayout_testDrawOrder_Highlight_on_top_of_Background()
201 LineBackgroundSpan span = mock(LineBackgroundSpan.class); in testDynamicLayout_testDrawOrder_Highlight_on_top_of_Background() local
202 ss.setSpan(span, 4, 8, Spanned.SPAN_INCLUSIVE_EXCLUSIVE); in testDynamicLayout_testDrawOrder_Highlight_on_top_of_Background()
210 InOrder order = inOrder(canvas, span); in testDynamicLayout_testDrawOrder_Highlight_on_top_of_Background()
211 order.verify(span) in testDynamicLayout_testDrawOrder_Highlight_on_top_of_Background()
DSpannableStringTest.java224 final AlignmentSpan.Standard span = new AlignmentSpan.Standard( in testCopyConstructorDoesNotEnforceParagraphStyleConstraint() local
226 original.setSpan(span, 1, original.length() - 1, Spanned.SPAN_PARAGRAPH); in testCopyConstructorDoesNotEnforceParagraphStyleConstraint()
DPrecomputedTextTest.java284 final BackgroundColorSpan span = new BackgroundColorSpan(Color.RED); in testSpannedInterface_Spannable() local
289 s.setSpan(span, SPAN_START, SPAN_END, Spanned.SPAN_INCLUSIVE_EXCLUSIVE); in testSpannedInterface_Spannable()
292 assertEquals(SPAN_START, s.getSpanStart(span)); in testSpannedInterface_Spannable()
293 assertEquals(SPAN_END, s.getSpanEnd(span)); in testSpannedInterface_Spannable()
294 assertTrue((s.getSpanFlags(span) & Spanned.SPAN_INCLUSIVE_EXCLUSIVE) != 0); in testSpannedInterface_Spannable()
300 s.removeSpan(span); in testSpannedInterface_Spannable()
DSpannableStringBuilderTest.java393 final QuoteSpan span = new QuoteSpan(); in testAppend_textWithSpan() local
396 builder.append("planet", span, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); in testAppend_textWithSpan()
406 assertSame("Should be the same span instance", span, spans[0]); in testAppend_textWithSpan()
DDynamicLayoutTest.java533 final TypefaceSpan span = mock(TypefaceSpan.class); in testReflow_afterSpanChangedShouldNotThrowException() local
534 builder.setSpan(span, 1, 4, SPAN_EXCLUSIVE_EXCLUSIVE); in testReflow_afterSpanChangedShouldNotThrowException()
/cts/tests/tests/widget/src/android/widget/cts/
DDialerFilterTest.java287 Spannable span = (Spannable) mDialerFilter.getLetters(); in testSetLettersWatcher() local
288 assertEquals(-1, span.getSpanStart(mockTextWatcher)); in testSetLettersWatcher()
289 assertEquals(-1, span.getSpanEnd(mockTextWatcher)); in testSetLettersWatcher()
297 span = (Spannable) mDialerFilter.getLetters(); in testSetLettersWatcher()
298 assertEquals(0, span.getSpanStart(mockTextWatcher)); in testSetLettersWatcher()
299 assertEquals(mDialerFilter.getLetters().length(), span.getSpanEnd(mockTextWatcher)); in testSetLettersWatcher()
300 assertEquals("ANDROID", span.toString()); in testSetLettersWatcher()
322 Spannable span = (Spannable) mDialerFilter.getDigits(); in testSetDigitsWatcher() local
323 assertEquals(-1, span.getSpanStart(mockTextWatcher)); in testSetDigitsWatcher()
324 assertEquals(-1, span.getSpanEnd(mockTextWatcher)); in testSetDigitsWatcher()
[all …]
DTableRow_LayoutParamsTest.java80 assertEquals(1, layoutParams.span); in testConstructor()
88 assertEquals(1, layoutParams.span); in testConstructor()
93 assertEquals(1, layoutParams.span); in testConstructor()
97 assertEquals(1, layoutParams.span); in testConstructor()
103 assertEquals(0, layoutParams.span); in testConstructor()
109 assertEquals(0, layoutParams.span); in testConstructor()
119 assertEquals(2, layoutParams.span); in testConstructor()
DTextViewStyleShortcutTest.java131 final StyleSpan span = spans[i]; in assertBoldRegion() local
132 if ((span.getStyle() & Typeface.BOLD) == Typeface.BOLD) { in assertBoldRegion()
133 actualList.add(new Range(spanned.getSpanStart(span), spanned.getSpanEnd(span))); in assertBoldRegion()
149 final StyleSpan span = spans[i]; in assertItalicRegion() local
150 if ((span.getStyle() & Typeface.ITALIC) == Typeface.ITALIC) { in assertItalicRegion()
151 actualList.add(new Range(spanned.getSpanStart(span), spanned.getSpanEnd(span))); in assertItalicRegion()
167 final UnderlineSpan span = spans[i]; in assertUnderlineRegion() local
168 actualRanges[i] = new Range(spanned.getSpanStart(span), spanned.getSpanEnd(span)); in assertUnderlineRegion()
/cts/tests/tests/text/src/android/text/method/cts/
DDialerKeyListenerTest.java52 SpannableString span = new SpannableString(""); // no meta spans in testLookup() local
57 assertEquals(keyChar, mockDialerKeyListener.lookup(keyEvent, span)); in testLookup()
67 SpannableString span = new SpannableString(""); // no meta spans in testLookupNull() local
68 mockDialerKeyListener.lookup(null, span); in testLookupNull()
DSingleLineTransformationMethodTest.java87 final AlignmentSpan.Standard span = new AlignmentSpan.Standard( in testSubsequence_doesNotThrowExceptionWithParagraphSpans() local
89 original.setSpan(span, 1, original.length() - 1, Spanned.SPAN_PARAGRAPH); in testSubsequence_doesNotThrowExceptionWithParagraphSpans()
DLinkMovementMethodTest.java139 Object span = spannable.getSpans(0, spannable.length(), Object.class)[0]; in testOnTakeFocus() local
140 assertEquals(0, spannable.getSpanStart(span)); in testOnTakeFocus()
141 assertEquals(0, spannable.getSpanEnd(span)); in testOnTakeFocus()
142 assertEquals(Spanned.SPAN_POINT_POINT, spannable.getSpanFlags(span)); in testOnTakeFocus()
/cts/tests/inputmethod/src/android/view/inputmethod/cts/
DExtractedTextTest.java65 final Annotation span = new Annotation("testHintKey", "testHintValue"); in getExpectedHint() local

12