Files
sousa-gecko/testing/web-platform/tests/html/semantics/permission-element/usermedia/onstream-attribute.html
T
Ravjit Uppal 5efc605d18 Bug 2043134 [wpt PR 60219] - Revert "[CE] Restrict HTMLUserMediaElement to secure contexts.", a=testonly
Automatic update from web-platform-tests
Revert "[CE] Restrict HTMLUserMediaElement to secure contexts."

This reverts commit b19dcb3fbef12eab1aa4b75f61830f93d5f67d68.

Reason for revert: The spec has been changed to not support this.

Original change's description:
> [CE] Restrict HTMLUserMediaElement to secure contexts.
>
> This change adds the SecureContext attribute to the HTMLUserMediaElement
> interface and its partial interfaces, ensuring that this API is only
> available in secure contexts. A new web platform test is added to verify
> that HTMLUserMediaElement is not exposed in insecure contexts.
>
> Bug: 512424738
> Change-Id: I4205ba6661da1c10877198b6bec2d9110b0dc5e8
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7840992
> Commit-Queue: Ravjit Uppal <ravjit@chromium.org>
> Reviewed-by: Joey Arhar <jarhar@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1633459}

Bug: 512424738
Change-Id: I616ccec69d676b43185744b2c31058192711faaa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7871580
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Commit-Queue: Ravjit Uppal <ravjit@chromium.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1637606}

--

wpt-commits: 28adb6bcb212c718675ff6bce8be9bb9f10bea24
wpt-pr: 60219
2026-06-02 10:26:16 +00:00

42 lines
1.4 KiB
HTML

<!doctype html>
<meta charset="utf-8" />
<title>HTMLUserMediaElement: onstream attribute</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<script>
test(() => {
const element = document.createElement("usermedia");
element.setConstraints({ video: {} });
assert_true("onstream" in element, "onstream should be in element");
let called = false;
element.onstream = () => {
called = true;
};
element.dispatchEvent(new Event("stream"));
assert_true(called, "onstream IDL attribute should work");
}, "onstream IDL attribute");
test(() => {
const container = document.createElement("div");
container.innerHTML = '<usermedia onstream="window.onstream_called = true"></usermedia>';
const element = container.firstChild;
window.onstream_called = false;
element.dispatchEvent(new Event("stream"));
assert_true(window.onstream_called, "onstream HTML attribute should work");
}, "onstream HTML attribute");
test(() => {
const element = document.createElement("usermedia");
let called = false;
element.addEventListener("stream", () => {
called = true;
});
element.dispatchEvent(new Event("stream"));
assert_true(called, 'addEventListener("stream") should work');
}, "addEventListener stream");
</script>
</body>