35
35
assert_not_equals ( video . srcObject , null ) ;
36
36
let settings = track . getSettings ( ) ;
37
37
let capabilities = track . getCapabilities ( ) ;
38
- assert_greater_than ( settings . physicalWidth , 0 ) ;
39
- assert_greater_than ( settings . physicalHeight , 0 ) ;
40
- assert_equals ( settings . physicalWidth / screenDetails . screens [ 0 ] . devicePixelRatio , settings . logicalWidth ) ;
41
- assert_equals ( settings . physicalHeight / screenDetails . screens [ 0 ] . devicePixelRatio , settings . logicalHeight ) ;
38
+ assert_greater_than ( capabilities . width . max , 0 ) ;
39
+ assert_greater_than ( capabilities . height . max , 0 ) ;
42
40
assert_equals ( screenDetails . screens [ 0 ] . devicePixelRatio , settings . screenPixelRatio ) ;
43
- assert_equals ( capabilities . width . max , settings . physicalWidth ) ;
44
- assert_equals ( capabilities . height . max , settings . physicalHeight ) ;
45
41
} ;
46
42
setTimeout ( ( ) => { video . requestVideoFrameCallback ( onFrame ) ; } , 100 ) ;
47
- } , "getDisplayMedia() and resolution for captured surface type monitor" ) ;
43
+ } , "getDisplayMedia() and screenPixelRatio for captured surface type monitor" ) ;
48
44
49
45
promise_test ( async t => {
50
46
var video = document . createElement ( "video" ) ;
60
56
assert_not_equals ( video . srcObject , null ) ;
61
57
let settings = track . getSettings ( ) ;
62
58
let capabilities = track . getCapabilities ( ) ;
63
- assert_greater_than ( settings . physicalWidth , 0 ) ;
64
- assert_greater_than ( settings . physicalHeight , 0 ) ;
65
- assert_equals ( settings . physicalWidth / screenDetails . screens [ 0 ] . devicePixelRatio , settings . logicalWidth ) ;
66
- assert_equals ( settings . physicalHeight / screenDetails . screens [ 0 ] . devicePixelRatio , settings . logicalHeight ) ;
59
+ assert_greater_than ( capabilities . width . max , 0 ) ;
60
+ assert_greater_than ( capabilities . height . max , 0 ) ;
67
61
assert_equals ( screenDetails . screens [ 0 ] . devicePixelRatio , settings . screenPixelRatio ) ;
68
- assert_equals ( capabilities . width . max , settings . physicalWidth ) ;
69
- assert_equals ( capabilities . height . max , settings . physicalHeight ) ;
70
62
} ;
71
63
setTimeout ( ( ) => { video . requestVideoFrameCallback ( onFrame ) ; } , 100 ) ;
72
- } , "getDisplayMedia() and resolution for captured surface type window" ) ;
64
+ } , "getDisplayMedia() and screenPixelRatio for captured surface type window" ) ;
73
65
74
66
promise_test ( async t => {
75
67
var video = document . createElement ( "video" ) ;
83
75
assert_not_equals ( video . srcObject , null ) ;
84
76
let settings = track . getSettings ( ) ;
85
77
let capabilities = track . getCapabilities ( ) ;
86
- assert_greater_than ( settings . physicalWidth , 0 ) ;
87
- assert_greater_than ( settings . physicalHeight , 0 ) ;
88
- assert_equals ( settings . physicalWidth / window . devicePixelRatio , settings . logicalWidth ) ;
89
- assert_equals ( settings . physicalHeight / window . devicePixelRatio , settings . logicalHeight ) ;
78
+ assert_greater_than ( capabilities . width . max , 0 ) ;
79
+ assert_greater_than ( capabilities . height . max , 0 ) ;
90
80
assert_equals ( window . devicePixelRatio , settings . screenPixelRatio ) ;
91
- assert_equals ( capabilities . width . max , settings . physicalWidth ) ;
92
- assert_equals ( capabilities . height . max , settings . physicalHeight ) ;
93
81
} ;
94
82
setTimeout ( ( ) => { video . requestVideoFrameCallback ( onFrame ) ; } , 100 ) ;
95
- } , "getDisplayMedia() and resolution for captured surface type browser" ) ;
83
+ } , "getDisplayMedia() and screenPixelRatio for captured surface type browser" ) ;
96
84
97
85
promise_test ( async t => {
98
86
var video = document . createElement ( "video" ) ;
110
98
let capabilities = track . getCapabilities ( ) ;
111
99
let oldWidth = settings . width ;
112
100
let oldHeight = settings . height ;
113
- let oldPhysicalWidth = settings . physicalWidth ;
114
- let oldPhysicalHeight = settings . physicalHeight ;
101
+ let oldCapbilitiesWidth = capabilities . width . max ;
102
+ let oldCapabilitiesHeight = capabilities . height . max ;
115
103
assert_greater_than ( settings . width , 0 ) ;
116
104
assert_greater_than ( settings . height , 0 ) ;
117
105
118
106
await track . applyConstraints ( { width : { max : oldWidth / 2 } , height : { max : oldHeight / 2 } } ) ;
119
107
settings = track . getSettings ( ) ;
120
108
assert_less_than_equal ( settings . width , oldWidth ) ;
121
109
assert_less_than_equal ( settings . height , oldHeight ) ;
122
- assert_equals ( oldPhysicalWidth , settings . physicalWidth ) ;
123
- assert_equals ( oldPhysicalHeight , settings . physicalHeight ) ;
124
- assert_equals ( oldPhysicalWidth / screenDetails . screens [ 0 ] . devicePixelRatio , settings . logicalWidth ) ;
125
- assert_equals ( oldPhysicalHeight / screenDetails . screens [ 0 ] . devicePixelRatio , settings . logicalHeight ) ;
126
110
assert_equals ( screenDetails . screens [ 0 ] . devicePixelRatio , settings . screenPixelRatio ) ;
127
- assert_equals ( capabilities . width . max , settings . physicalWidth ) ;
128
- assert_equals ( capabilities . height . max , settings . physicalHeight ) ;
111
+ assert_equals ( capabilities . width . max , oldCapbilitiesWidth ) ;
112
+ assert_equals ( capabilities . height . max , oldCapabilitiesHeight ) ;
129
113
} ;
130
114
setTimeout ( ( ) => { video . requestVideoFrameCallback ( onFrame ) ; } , 100 ) ;
131
- } , "applyConstraints() should not change the physical and logical size of captured surface type monitor" ) ;
115
+ } , "applyConstraints() should not change the capabilities resolution and screenPixelRatio of captured surface type monitor" ) ;
132
116
133
117
promise_test ( async t => {
134
118
var video = document . createElement ( "video" ) ;
146
130
let capabilities = track . getCapabilities ( ) ;
147
131
let oldWidth = settings . width ;
148
132
let oldHeight = settings . height ;
149
- let oldPhysicalWidth = settings . physicalWidth ;
150
- let oldPhysicalHeight = settings . physicalHeight ;
133
+ let oldCapbilitiesWidth = capabilities . width . max ;
134
+ let oldCapabilitiesHeight = capabilities . height . max ;
151
135
assert_greater_than ( settings . width , 0 ) ;
152
136
assert_greater_than ( settings . height , 0 ) ;
153
137
154
138
await track . applyConstraints ( { width : { max : oldWidth / 2 } , height : { max : oldHeight / 2 } } ) ;
155
139
settings = track . getSettings ( ) ;
156
140
assert_less_than_equal ( settings . width , oldWidth ) ;
157
141
assert_less_than_equal ( settings . height , oldHeight ) ;
158
- assert_equals ( oldPhysicalWidth , settings . physicalWidth ) ;
159
- assert_equals ( oldPhysicalHeight , settings . physicalHeight ) ;
160
- assert_equals ( oldPhysicalWidth / screenDetails . screens [ 0 ] . devicePixelRatio , settings . logicalWidth ) ;
161
- assert_equals ( oldPhysicalHeight / screenDetails . screens [ 0 ] . devicePixelRatio , settings . logicalHeight ) ;
162
142
assert_equals ( screenDetails . screens [ 0 ] . devicePixelRatio , settings . screenPixelRatio ) ;
163
- assert_equals ( capabilities . width . max , settings . physicalWidth ) ;
164
- assert_equals ( capabilities . height . max , settings . physicalHeight ) ;
143
+ assert_equals ( capabilities . width . max , oldCapbilitiesWidth ) ;
144
+ assert_equals ( capabilities . height . max , oldCapabilitiesHeight ) ;
165
145
} ;
166
146
setTimeout ( ( ) => { video . requestVideoFrameCallback ( onFrame ) ; } , 100 ) ;
167
- } , "applyConstraints() should not change the physical and logical size of captured surface type window" ) ;
147
+ } , "applyConstraints() should not change the capabilities resolution and screenPixelRatio of captured surface type window" ) ;
168
148
169
149
promise_test ( async t => {
170
150
var video = document . createElement ( "video" ) ;
180
160
let capabilities = track . getCapabilities ( ) ;
181
161
let oldWidth = settings . width ;
182
162
let oldHeight = settings . height ;
183
- let oldPhysicalWidth = settings . physicalWidth ;
184
- let oldPhysicalHeight = settings . physicalHeight ;
163
+ let oldCapbilitiesWidth = capabilities . width . max ;
164
+ let oldCapabilitiesHeight = capabilities . height . max ;
185
165
assert_greater_than ( settings . width , 0 ) ;
186
166
assert_greater_than ( settings . height , 0 ) ;
187
167
188
168
await track . applyConstraints ( { width : { max : oldWidth / 2 } , height : { max : oldHeight / 2 } } ) ;
189
169
settings = track . getSettings ( ) ;
190
170
assert_less_than_equal ( settings . width , oldWidth ) ;
191
171
assert_less_than_equal ( settings . height , oldHeight ) ;
192
- assert_equals ( oldPhysicalWidth , settings . physicalWidth ) ;
193
- assert_equals ( oldPhysicalHeight , settings . physicalHeight ) ;
194
- assert_equals ( oldPhysicalWidth / window . devicePixelRatio , settings . logicalWidth ) ;
195
- assert_equals ( oldPhysicalHeight / window . devicePixelRatio , settings . logicalHeight ) ;
196
- assert_equals ( window . devicePixelRatio , settings . screenPixelRatio ) ;
197
- assert_equals ( capabilities . width . max , settings . physicalWidth ) ;
198
- assert_equals ( capabilities . height . max , settings . physicalHeight ) ;
172
+ assert_equals ( screenDetails . screens [ 0 ] . devicePixelRatio , settings . screenPixelRatio ) ;
173
+ assert_equals ( capabilities . width . max , oldCapbilitiesWidth ) ;
174
+ assert_equals ( capabilities . height . max , oldCapabilitiesHeight ) ;
199
175
} ;
200
176
setTimeout ( ( ) => { video . requestVideoFrameCallback ( onFrame ) ; } , 100 ) ;
201
- } , "applyConstraints() should not change the physical and logical size of captured surface type browser" ) ;
177
+ } , "applyConstraints() should not change the capabilities resolution and screenPixelRatio of captured surface type browser" ) ;
202
178
203
179
204
180
</ script >
0 commit comments