Skip to content

Commit c393587

Browse files
committed
Enable AudioSession Web API by default, but only a reduced subset
https://bugs.webkit.org/show_bug.cgi?id=250764 rdar://104381410 Reviewed by Eric Carlson. Enable by default navigator.audioSession and navigator.audioSession.type but not the state/event API. For that purpose, introduce a second flag for the extended API. Update LayoutTests/media/audioSession/audioSessionType.html to cover the new flag. Remove the flaky test expectations for two related audioSession tests since they are no longer flaky in bots. * LayoutTests/media/audioSession/audioSessionType.html: * LayoutTests/platform/mac-wk2/TestExpectations: * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: * Source/WebCore/Modules/audiosession/DOMAudioSession.idl: Canonical link: https://commits.webkit.org/259074@main
1 parent 892b93e commit c393587

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

LayoutTests/media/audioSession/audioSessionType.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!doctype html>
1+
<!doctype html><!-- webkit-test-runner [ DOMAudioSessionFullEnabled=false ] -->
22
<html>
33
<head>
44
<meta charset="utf-8">
@@ -26,7 +26,9 @@
2626

2727
promise_test(async (test) => {
2828
assert_equals(navigator.audioSession.type, "auto");
29-
29+
assert_equals(AudioSession.prototype.state, undefined);
30+
assert_equals(AudioSession.prototype.onstatechange, undefined);
31+
3032
if (!window.internals)
3133
return;
3234

LayoutTests/platform/mac-wk2/TestExpectations

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,7 +1808,3 @@ webkit.org/b/250784 media/audio-session-category.html [ Pass Failure ]
18081808
[ BigSur+ ] imported/w3c/web-platform-tests/service-workers/cache-storage/cross-partition.https.tentative.html [ Pass Failure Crash ]
18091809

18101810
webkit.org/b/248997 [ BigSur+ ] http/tests/navigation/fragment-navigation-policy-ignore.html [ Pass Failure ]
1811-
1812-
webkit.org/b/249407 [ BigSur+ ] media/audioSession/getUserMedia.html [ Failure ]
1813-
1814-
webkit.org/b/249486 [ BigSur+ ] media/audioSession/audioSessionType.html [ Failure ]

Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,8 +1507,22 @@ DNSPrefetchingEnabled:
15071507
DOMAudioSessionEnabled:
15081508
type: bool
15091509
status: testable
1510-
humanReadableName: "AudioSession"
1511-
humanReadableDescription: "Enable AudioSession"
1510+
humanReadableName: "AudioSession API"
1511+
humanReadableDescription: "Enable AudioSession API"
1512+
condition: ENABLE(DOM_AUDIO_SESSION)
1513+
defaultValue:
1514+
WebKitLegacy:
1515+
default: false
1516+
WebKit:
1517+
default: true
1518+
WebCore:
1519+
default: true
1520+
1521+
DOMAudioSessionFullEnabled:
1522+
type: bool
1523+
status: testable
1524+
humanReadableName: "AudioSession full API"
1525+
humanReadableDescription: "Enable AudioSession full API"
15121526
condition: ENABLE(DOM_AUDIO_SESSION)
15131527
defaultValue:
15141528
WebKitLegacy:

Source/WebCore/Modules/audiosession/DOMAudioSession.idl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ enum DOMAudioSessionType {
4747
] interface DOMAudioSession : EventTarget {
4848
attribute DOMAudioSessionType type;
4949

50-
readonly attribute DOMAudioSessionState state;
51-
attribute EventHandler onstatechange;
50+
[EnabledBySetting=DOMAudioSessionFullEnabled] readonly attribute DOMAudioSessionState state;
51+
[EnabledBySetting=DOMAudioSessionFullEnabled] attribute EventHandler onstatechange;
5252
};

0 commit comments

Comments
 (0)