@@ -90,21 +90,26 @@ describe('UITextDisplayer', () => {
90
90
videoContainer . querySelector ( '.shaka-text-container' ) ;
91
91
const captions = textContainer . querySelector ( 'span' ) ;
92
92
const cssObj = parseCssText ( captions . style . cssText ) ;
93
- expect ( cssObj ) . toEqual (
94
- jasmine . objectContaining ( {
95
- 'color' : 'green' ,
96
- 'background-color' : 'black' ,
97
- 'direction' : 'ltr' ,
98
- 'font-size' : '10px' ,
99
- 'font-style' : 'normal' ,
100
- 'font-weight' : 400 ,
101
- 'line-height' : 2 ,
102
- 'text-align' : 'center' ,
103
- // TODO: Old versions of Tizen and WebOS only supports the webkit
104
- // prefixed version. Until we support the prefixed version, this
105
- // has to be maintained. https://caniuse.com/css-writing-mode
106
- // 'writing-mode': 'horizontal-tb',
107
- } ) ) ;
93
+
94
+ const expectCssObj = {
95
+ 'color' : 'green' ,
96
+ 'background-color' : 'black' ,
97
+ 'direction' : 'ltr' ,
98
+ 'font-size' : '10px' ,
99
+ 'font-style' : 'normal' ,
100
+ 'font-weight' : 400 ,
101
+ 'line-height' : 2 ,
102
+ 'text-align' : 'center' ,
103
+ } ;
104
+ // Old versions of Tizen and WebOS only supports the webkit prefixed
105
+ // version. https://caniuse.com/css-writing-mode
106
+ if ( 'writingMode' in document . documentElement . style ) {
107
+ expectCssObj [ 'writing-mode' ] = 'horizontal-tb' ;
108
+ } else if ( 'webkitWritingMode' in document . documentElement . style ) {
109
+ expectCssObj [ '-webkit-writing-mode' ] = 'horizontal-tb' ;
110
+ }
111
+
112
+ expect ( cssObj ) . toEqual ( jasmine . objectContaining ( expectCssObj ) ) ;
108
113
} ) ;
109
114
110
115
it ( 'correctly displays styles for nested cues' , async ( ) => {
@@ -132,19 +137,24 @@ describe('UITextDisplayer', () => {
132
137
videoContainer . querySelector ( '.shaka-text-container' ) ;
133
138
const captions = textContainer . querySelector ( 'span' ) ;
134
139
const cssObj = parseCssText ( captions . style . cssText ) ;
135
- expect ( cssObj ) . toEqual (
136
- jasmine . objectContaining ( {
137
- 'color' : 'green' ,
138
- 'background-color' : 'black' ,
139
- 'font-size' : '10px' ,
140
- 'font-style' : 'normal' ,
141
- 'font-weight' : 400 ,
142
- 'text-align' : 'center' ,
143
- // TODO: Old versions of Tizen and WebOS only supports the webkit
144
- // prefixed version. Until we support the prefixed version, this
145
- // has to be maintained. https://caniuse.com/css-writing-mode
146
- // 'writing-mode': 'horizontal-tb',
147
- } ) ) ;
140
+
141
+ const expectCssObj = {
142
+ 'color' : 'green' ,
143
+ 'background-color' : 'black' ,
144
+ 'font-size' : '10px' ,
145
+ 'font-style' : 'normal' ,
146
+ 'font-weight' : 400 ,
147
+ 'text-align' : 'center' ,
148
+ } ;
149
+ // Old versions of Tizen and WebOS only supports the webkit prefixed
150
+ // version. https://caniuse.com/css-writing-mode
151
+ if ( 'writingMode' in document . documentElement . style ) {
152
+ expectCssObj [ 'writing-mode' ] = 'horizontal-tb' ;
153
+ } else if ( 'webkitWritingMode' in document . documentElement . style ) {
154
+ expectCssObj [ '-webkit-writing-mode' ] = 'horizontal-tb' ;
155
+ }
156
+
157
+ expect ( cssObj ) . toEqual ( jasmine . objectContaining ( expectCssObj ) ) ;
148
158
} ) ;
149
159
150
160
it ( 'correctly displays styles for cellResolution units' , async ( ) => {
0 commit comments