Skip to content

Commit d4a5194

Browse files
Thomas Nguyenchromium-wpt-export-bot
authored andcommitted
[CE] Correct logic of DefaultEventHandler in HTMLUserMediaElement
Ensure that HTMLUserMediaElement does not initiate multiple concurrent media stream requests. Previously, rapid user activations could trigger overlapping requests before the initial one had completed. Additionally, the activation logic was updated to use the base capability element's activation handler, ensuring that permission checks and media requests are correctly synchronized with user events. Fixed: 5003039 Change-Id: I84f733a590d24d0fa60c08a49fc3a19b9314c695 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7734929 Reviewed-by: Joey Arhar <jarhar@chromium.org> Commit-Queue: Thomas Nguyen <tungnh@chromium.org> Cr-Commit-Position: refs/heads/main@{#1616082}
1 parent 7fe20e4 commit d4a5194

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

html/semantics/permission-element/usermedia/set-constraints-combinations.tentative.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@
7878
// should_trigger is true if the element has at least one permission descriptor.
7979
const should_trigger = (type !== null) || (video === true) || (audio === true);
8080

81-
// Wait for PEPC registration
82-
await new Promise(r => t.step_timeout(r, 100));
81+
// Wait until the element is clickable.
82+
await new Promise(r => t.step_timeout(r, 600));
8383

8484
if (should_trigger) {
85-
await test_driver.bless("click", () => usermedia.click());
85+
await test_driver.click(usermedia);
8686
await stream_promise;
8787
} else {
88-
await test_driver.bless("click", () => usermedia.click());
88+
await test_driver.click(usermedia);
8989
// Wait a bit to ensure no stream event is fired
9090
await new Promise(r => t.step_timeout(r, 200));
9191
}

html/semantics/permission-element/usermedia/usermedia-constraints-descriptors.tentative.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
}
2828

2929
await Promise.all(permissions);
30+
// Wait until the element is clickable.
31+
await new Promise(resolve => t.step_timeout(resolve, 600));
3032
await test_driver.click(usermedia);
3133

3234
const e = await stream_promise;

html/semantics/permission-element/usermedia/usermedia-no-constraints.tentative.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
test_driver.set_permission({name: 'microphone'}, 'granted')
2424
]);
2525

26+
// Wait until the element is clickable.
27+
await new Promise(resolve => t.step_timeout(resolve, 600));
2628
await test_driver.click(usermedia);
2729

2830
// Wait a bit to see if 'onstream' fires.
@@ -48,6 +50,8 @@
4850
test_driver.set_permission({name: 'microphone'}, 'granted')
4951
]);
5052

53+
// Wait until the element is clickable.
54+
await new Promise(resolve => t.step_timeout(resolve, 600));
5155
await test_driver.click(usermedia);
5256

5357
// Wait a bit to see if 'onstream' fires.
@@ -68,6 +72,8 @@
6872
});
6973

7074
await test_driver.set_permission({name: 'camera'}, 'granted');
75+
// Wait until the element is clickable.
76+
await new Promise(resolve => t.step_timeout(resolve, 600));
7177
await test_driver.click(usermedia);
7278

7379
const e = await stream_promise;

0 commit comments

Comments
 (0)