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

Commit 3f6e1185 authored by Edgar Wang's avatar Edgar Wang
Browse files

Add test case to check LineBreakWordStyle

After Android T, settings apply phrase-based breaking

Bug: 240462331
Test: robotest
Change-Id: Iaf0f37f0b2eea6a4dcd45582f29b8c37ffea4e38
parent 15a8232e
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.settingslib.widget;

import static android.graphics.text.LineBreakConfig.LINE_BREAK_WORD_STYLE_PHRASE;

import static com.google.common.truth.Truth.assertThat;

import android.content.Context;
@@ -97,4 +99,14 @@ public class MainSwitchBarTest {

        assertThat(mBar.getVisibility()).isEqualTo(View.GONE);
    }

    @Test
    public void setTitle_shouldSetCorrectLineBreakStyle() {
        final String title = "title";

        mBar.setTitle(title);
        final TextView textView = ((TextView) mBar.findViewById(R.id.switch_text));

        assertThat(textView.getLineBreakWordStyle()).isEqualTo(LINE_BREAK_WORD_STYLE_PHRASE);
    }
}