mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Add unit tests for TTML region attrs in style, chained styles UT
This commit is contained in:
parent
026700a9d9
commit
82bed39140
@ -1107,6 +1107,11 @@ public final class TtmlParserTest {
|
||||
assertThat(secondCue.position).isEqualTo(30f / 100f);
|
||||
assertThat(secondCue.line).isEqualTo(30f / 100f);
|
||||
assertThat(secondCue.size).isEqualTo(40f / 100f);
|
||||
|
||||
Cue thirdCue = Iterables.getOnlyElement(allCues.get(2).cues);
|
||||
assertThat(thirdCue.position).isEqualTo(30f / 100f);
|
||||
assertThat(thirdCue.line).isEqualTo(30f / 100f);
|
||||
assertThat(thirdCue.size).isEqualTo(20f / 100f);
|
||||
}
|
||||
|
||||
private static Spanned getOnlyCueTextAtIndex(List<CuesWithTiming> allCues, int index) {
|
||||
|
@ -4,16 +4,19 @@
|
||||
<styling>
|
||||
<style xml:id="style1" tts:extent="20% 20%" />
|
||||
<style xml:id="style2" tts:origin="30% 30%" />
|
||||
<style xml:id="style3" style="style1 style2" />
|
||||
</styling>
|
||||
<layout>
|
||||
<region xml:id="region1" style="style1" tts:origin="10% 10%" />
|
||||
<region xml:id="region2" style="style2" tts:extent="40% 40%" />
|
||||
<region xml:id="region3" style="style3" />
|
||||
</layout>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<p begin="2s" end="4s" region="region1">text 1</p>
|
||||
<p begin="4s" end="6s" region="region2">text 2</p>
|
||||
<p begin="8s" end="10s" region="region3">text 3</p>
|
||||
</div>
|
||||
</body>
|
||||
</tt>
|
||||
|
Loading…
x
Reference in New Issue
Block a user