Files
tubestation/testing/web-platform/tests/audio-output/setSinkId.https.html
Guido Urdaneta b506244131 Bug 1656338 [wpt PR 24817] - Revert "Reland "Reland "Do not expose media devices before a successful getUserMedia()""", a=testonly
Automatic update from web-platform-tests
Revert "Reland "Reland "Do not expose media devices before a successful getUserMedia()"""

This reverts commit 051a934da99eb3f1c454945ec789d2f787144c99.

Reason for revert: crbug.com/1111333

Original change's description:
> Reland "Reland "Do not expose media devices before a successful getUserMedia()""
>
> This reverts commit e5e98cf1e56a06e03f3d3f71bfe854cdc3ea13ef.
>
> Reason for revert: Tests have been corrected. New attempt.
>
> Original change's description:
> > Revert "Reland "Do not expose media devices before a successful getUserMedia()""
> >
> > This reverts commit 8b10bc20f5a16c1257a472c70afa0cd58c49a8be.
> >
> > Reason for revert: camera.CCAUISanity.fake is failing again: https://ci.chromium.org/p/chromium/builders/ci/chromeos-kevin-rel/27932
> >
> > Original change's description:
> > > Reland "Do not expose media devices before a successful getUserMedia()"
> > >
> > > This reverts commit 69a6001995c51516b403dbde99a2db4c5054ce55.
> > >
> > > chrome-prefixed URLs are exempted from the getUserMedia() requirement.
> > >
> > > Original change's description:
> > > > Revert "Do not expose media devices before a successful getUserMedia()"
> > > >
> > > > This reverts commit d64e736aa8c7976b12b33f92472f7950bf0215b9.
> > > >
> > > > Reason for revert: Caused chrome_all_tast_tests / camera.CCAUISanity.fake failures; e.g. https://ci.chromium.org/p/chrome/builders/ci/chromeos-betty-pi-arc-chrome/7680
> > > >
> > > > Original change's description:
> > > > > Do not expose media devices before a successful getUserMedia()
> > > > >
> > > > > This is a spec-compliance change.
> > > > >
> > > > > This CL also adds some improvements to the blink MediaDevices unit test.
> > > > >
> > > > > Bug: 1101860
> > > > > Change-Id: If2e7824df3b3dbd3cdb80f4bcf6b5c417d6f0ef2
> > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2279808
> > > > > Commit-Queue: Guido Urdaneta <guidou@chromium.org>
> > > > > Reviewed-by: Harald Alvestrand <hta@chromium.org>
> > > > > Cr-Commit-Position: refs/heads/master@{#786253}
> > > >
> > > > TBR=hta@chromium.org,guidou@chromium.org
> > > >
> > > > Change-Id: I41b676c7d3e437c06d23f2b46270453f1cc81670
> > > > No-Presubmit: true
> > > > No-Tree-Checks: true
> > > > No-Try: true
> > > > Bug: 1101860
> > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2288282
> > > > Reviewed-by: Mohsen Izadi <mohsen@chromium.org>
> > > > Commit-Queue: Mohsen Izadi <mohsen@chromium.org>
> > > > Cr-Commit-Position: refs/heads/master@{#786615}
> > >
> > > TBR=mohsen@chromium.org,hta@chromium.org,guidou@chromium.org
> > >
> > > # Not skipping CQ checks because this is a reland.
> > >
> > > Bug: 1101860
> > > Change-Id: I3fb6d9a620291cda57eb5fe48ce330b45425a5bc
> > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2289833
> > > Commit-Queue: Guido Urdaneta <guidou@chromium.org>
> > > Reviewed-by: Guido Urdaneta <guidou@chromium.org>
> > > Reviewed-by: Harald Alvestrand <hta@chromium.org>
> > > Cr-Commit-Position: refs/heads/master@{#791797}
> >
> > TBR=shik@chromium.org,hta@chromium.org,guidou@chromium.org,wtlee@chromium.org
> >
> > Change-Id: I6b18c308de10dc5e5251025fd887892ecfef938b
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: 1101860
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2320081
> > Reviewed-by: Adithya Srinivasan <adithyas@chromium.org>
> > Commit-Queue: Adithya Srinivasan <adithyas@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#791822}
>
> TBR=shik@chromium.org,hta@chromium.org,guidou@chromium.org,adithyas@chromium.org,wtlee@chromium.org
>
> # Not skipping CQ checks because this is a reland.
>
> Bug: 1101860
> Change-Id: I43537e2be617b8d66f40ba1cbd73771a07b79507
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2320791
> Reviewed-by: Guido Urdaneta <guidou@chromium.org>
> Commit-Queue: Guido Urdaneta <guidou@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#792234}

TBR=hta@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1101860
Change-Id: Iad98f466716d454011624ce7cb01d15981364904
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2330055
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Reviewed-by: Guido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#793324}

--

wpt-commits: 596f598004cc72ae3e3ccec41ec098da626e4ce1
wpt-pr: 24817
2020-08-15 07:03:33 +00:00

47 lines
2.0 KiB
HTML

<!doctype html>
<head>
<title>Test setSinkId behavior </title>
<link rel="author" title="Dominique Hazael-Massieux" href="mailto:dom@w3.org"/>
<link rel="help" href="https://www.w3.org/TR/audio-output/#dom-htmlmediaelement-setsinkid">
</head>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script>
"use strict";
const audio = new Audio();
promise_test(t => audio.setSinkId(""), "setSinkId on default audio output should always work");
promise_test(t => promise_rejects_dom(t, "NotFoundError", audio.setSinkId("nonexistent_device_id")),
"setSinkId fails with NotFoundError on made up deviceid");
promise_test(async t => {
const list = await navigator.mediaDevices.enumerateDevices();
const outputDevicesList = list.filter(({kind}) => kind == "audiooutput");
assert_not_equals(outputDevicesList.length, 0,
"media device list includes at least one audio output device");
let acceptedDevices = 0;
for (const {deviceId} of outputDevicesList) {
const {deviceId} = outputDevicesList[0];
const p1 = audio.setSinkId(deviceId);
assert_equals(audio.sinkId, "", "before it resolves, setSinkId is unchanged");
try {
let r = await p1;
assert_equals(acceptedDevices, 0, "only the default sink device can be set");
acceptedDevices++;
assert_equals(r, undefined, "setSinkId resolves with undefined");
assert_equals(audio.sinkId, deviceId, "when it resolves, setSinkId updates sinkId to the requested deviceId");
r = await audio.setSinkId(deviceId);
assert_equals(r, undefined, "resetting sinkid on same current value should always work");
r = await audio.setSinkId("");
assert_equals(r, undefined, "resetting sinkid on default audio output should always work");
} catch (e) {
assert_equals(e.name, "NotAllowedError", "Non-default devices are failing with NotAllowed error");
}
}
}, "List device, setSinkId should be allowed on the default, the rest of the devices will get a NotAllowedError");
</script>