Skip to content

Commit 5903faa

Browse files
palak8669chromium-wpt-export-bot
authored andcommitted
Remove physical and logical attributes in MediaTrackSettings idl
This ensures it is updated with the spec defined in https://w3c.github.io/mediacapture-screen-share/#dfn-screenpixelratio. Bug: 383946052 Change-Id: I61887b34756df0e755a49bfea6f9d2efcdcc071a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6410813 Reviewed-by: Guido Urdaneta <[email protected]> Commit-Queue: Guido Urdaneta <[email protected]> Cr-Commit-Position: refs/heads/main@{#1440113}
1 parent a6ee676 commit 5903faa

File tree

1 file changed

+25
-49
lines changed

1 file changed

+25
-49
lines changed

screen-capture/tentative/getdisplaymedia-captured-surface-resolution.https.html

Lines changed: 25 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,12 @@
3535
assert_not_equals(video.srcObject, null);
3636
let settings = track.getSettings();
3737
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);
4240
assert_equals(screenDetails.screens[0].devicePixelRatio, settings.screenPixelRatio);
43-
assert_equals(capabilities.width.max, settings.physicalWidth);
44-
assert_equals(capabilities.height.max, settings.physicalHeight);
4541
};
4642
setTimeout(() => { video.requestVideoFrameCallback(onFrame); }, 100);
47-
}, "getDisplayMedia() and resolution for captured surface type monitor");
43+
}, "getDisplayMedia() and screenPixelRatio for captured surface type monitor");
4844

4945
promise_test(async t => {
5046
var video = document.createElement("video");
@@ -60,16 +56,12 @@
6056
assert_not_equals(video.srcObject, null);
6157
let settings = track.getSettings();
6258
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);
6761
assert_equals(screenDetails.screens[0].devicePixelRatio, settings.screenPixelRatio);
68-
assert_equals(capabilities.width.max, settings.physicalWidth);
69-
assert_equals(capabilities.height.max, settings.physicalHeight);
7062
};
7163
setTimeout(() => { video.requestVideoFrameCallback(onFrame); }, 100);
72-
}, "getDisplayMedia() and resolution for captured surface type window");
64+
}, "getDisplayMedia() and screenPixelRatio for captured surface type window");
7365

7466
promise_test(async t => {
7567
var video = document.createElement("video");
@@ -83,16 +75,12 @@
8375
assert_not_equals(video.srcObject, null);
8476
let settings = track.getSettings();
8577
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);
9080
assert_equals(window.devicePixelRatio, settings.screenPixelRatio);
91-
assert_equals(capabilities.width.max, settings.physicalWidth);
92-
assert_equals(capabilities.height.max, settings.physicalHeight);
9381
};
9482
setTimeout(() => { video.requestVideoFrameCallback(onFrame); }, 100);
95-
}, "getDisplayMedia() and resolution for captured surface type browser");
83+
}, "getDisplayMedia() and screenPixelRatio for captured surface type browser");
9684

9785
promise_test(async t => {
9886
var video = document.createElement("video");
@@ -110,25 +98,21 @@
11098
let capabilities = track.getCapabilities();
11199
let oldWidth = settings.width;
112100
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;
115103
assert_greater_than(settings.width, 0);
116104
assert_greater_than(settings.height, 0);
117105

118106
await track.applyConstraints({ width: { max: oldWidth / 2 }, height: { max: oldHeight / 2 } });
119107
settings = track.getSettings();
120108
assert_less_than_equal(settings.width, oldWidth);
121109
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);
126110
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);
129113
};
130114
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");
132116

133117
promise_test(async t => {
134118
var video = document.createElement("video");
@@ -146,25 +130,21 @@
146130
let capabilities = track.getCapabilities();
147131
let oldWidth = settings.width;
148132
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;
151135
assert_greater_than(settings.width, 0);
152136
assert_greater_than(settings.height, 0);
153137

154138
await track.applyConstraints({ width: { max: oldWidth / 2 }, height: { max: oldHeight / 2 } });
155139
settings = track.getSettings();
156140
assert_less_than_equal(settings.width, oldWidth);
157141
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);
162142
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);
165145
};
166146
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");
168148

169149
promise_test(async t => {
170150
var video = document.createElement("video");
@@ -180,25 +160,21 @@
180160
let capabilities = track.getCapabilities();
181161
let oldWidth = settings.width;
182162
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;
185165
assert_greater_than(settings.width, 0);
186166
assert_greater_than(settings.height, 0);
187167

188168
await track.applyConstraints({ width: { max: oldWidth / 2 }, height: { max: oldHeight / 2 } });
189169
settings = track.getSettings();
190170
assert_less_than_equal(settings.width, oldWidth);
191171
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);
199175
};
200176
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");
202178

203179

204180
</script>

0 commit comments

Comments
 (0)