Title: [269203] trunk
Revision
269203
Author
cdu...@apple.com
Date
2020-10-30 13:09:56 -0700 (Fri, 30 Oct 2020)

Log Message

BaseAudioContext.decodeAudioData() should throw an InvalidStateError when document is not fully active
https://bugs.webkit.org/show_bug.cgi?id=218400

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline WPT tests that are now passing.

* web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/audiocontext-detached-execution-context-expected.txt:
* web-platform-tests/webaudio/the-audio-api/the-offlineaudiocontext-interface/offlineaudiocontext-detached-execution-context-expected.txt:

Source/WebCore:

BaseAudioContext.decodeAudioData() should throw an InvalidStateError when document is not fully active:
- https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-decodeaudiodata

We were previously throwing a NotAllowedError instead.

No new tests, rebaselined existing tests.

* Modules/webaudio/BaseAudioContext.cpp:
(WebCore::BaseAudioContext::decodeAudioData):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (269202 => 269203)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2020-10-30 18:06:27 UTC (rev 269202)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2020-10-30 20:09:56 UTC (rev 269203)
@@ -1,3 +1,15 @@
+2020-10-30  Chris Dumez  <cdu...@apple.com>
+
+        BaseAudioContext.decodeAudioData() should throw an InvalidStateError when document is not fully active
+        https://bugs.webkit.org/show_bug.cgi?id=218400
+
+        Reviewed by Darin Adler.
+
+        Rebaseline WPT tests that are now passing.
+
+        * web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/audiocontext-detached-execution-context-expected.txt:
+        * web-platform-tests/webaudio/the-audio-api/the-offlineaudiocontext-interface/offlineaudiocontext-detached-execution-context-expected.txt:
+
 2020-10-30  Rob Buis  <rb...@igalia.com>
 
         Resync web-platform-tests/css/css-sizing/aspect-ratio from upstream

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/audiocontext-detached-execution-context-expected.txt (269202 => 269203)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/audiocontext-detached-execution-context-expected.txt	2020-10-30 18:06:27 UTC (rev 269202)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/audiocontext-detached-execution-context-expected.txt	2020-10-30 20:09:56 UTC (rev 269203)
@@ -3,7 +3,7 @@
 PASS Executing "decoding-on-detached-iframe"
 PASS Audit report
 PASS > [decoding-on-detached-iframe]
-FAIL X decodeAudioData() upon a detached iframe rejected correctly but got NotAllowedError instead of InvalidStateError. Got Promise. assert_true: expected true got false
-FAIL < [decoding-on-detached-iframe] 1 out of 1 assertions were failed. assert_true: expected true got false
-FAIL # AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed. assert_true: expected true got false
+PASS   decodeAudioData() upon a detached iframe rejected correctly with InvalidStateError.
+PASS < [decoding-on-detached-iframe] All assertions passed. (total 1 assertions)
+PASS # AUDIT TASK RUNNER FINISHED: 1 tasks ran successfully.
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-offlineaudiocontext-interface/offlineaudiocontext-detached-execution-context-expected.txt (269202 => 269203)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-offlineaudiocontext-interface/offlineaudiocontext-detached-execution-context-expected.txt	2020-10-30 18:06:27 UTC (rev 269202)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-offlineaudiocontext-interface/offlineaudiocontext-detached-execution-context-expected.txt	2020-10-30 20:09:56 UTC (rev 269203)
@@ -3,7 +3,7 @@
 PASS Executing "decoding-on-detached-iframe"
 PASS Audit report
 PASS > [decoding-on-detached-iframe]
-FAIL X decodeAudioData() upon a detached iframe rejected correctly but got NotAllowedError instead of InvalidStateError. Got Promise. assert_true: expected true got false
-FAIL < [decoding-on-detached-iframe] 1 out of 1 assertions were failed. assert_true: expected true got false
-FAIL # AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed. assert_true: expected true got false
+PASS   decodeAudioData() upon a detached iframe rejected correctly with InvalidStateError.
+PASS < [decoding-on-detached-iframe] All assertions passed. (total 1 assertions)
+PASS # AUDIT TASK RUNNER FINISHED: 1 tasks ran successfully.
 

Modified: trunk/Source/WebCore/ChangeLog (269202 => 269203)


--- trunk/Source/WebCore/ChangeLog	2020-10-30 18:06:27 UTC (rev 269202)
+++ trunk/Source/WebCore/ChangeLog	2020-10-30 20:09:56 UTC (rev 269203)
@@ -1,3 +1,20 @@
+2020-10-30  Chris Dumez  <cdu...@apple.com>
+
+        BaseAudioContext.decodeAudioData() should throw an InvalidStateError when document is not fully active
+        https://bugs.webkit.org/show_bug.cgi?id=218400
+
+        Reviewed by Darin Adler.
+
+        BaseAudioContext.decodeAudioData() should throw an InvalidStateError when document is not fully active:
+        - https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-decodeaudiodata
+
+        We were previously throwing a NotAllowedError instead.
+
+        No new tests, rebaselined existing tests.
+
+        * Modules/webaudio/BaseAudioContext.cpp:
+        (WebCore::BaseAudioContext::decodeAudioData):
+
 2020-10-30  Youenn Fablet  <you...@apple.com>
 
         Increase camera failing timer to 30 seconds

Modified: trunk/Source/WebCore/Modules/webaudio/BaseAudioContext.cpp (269202 => 269203)


--- trunk/Source/WebCore/Modules/webaudio/BaseAudioContext.cpp	2020-10-30 18:06:27 UTC (rev 269202)
+++ trunk/Source/WebCore/Modules/webaudio/BaseAudioContext.cpp	2020-10-30 20:09:56 UTC (rev 269203)
@@ -339,7 +339,7 @@
 void BaseAudioContext::decodeAudioData(Ref<ArrayBuffer>&& audioData, RefPtr<AudioBufferCallback>&& successCallback, RefPtr<AudioBufferCallback>&& errorCallback, Optional<Ref<DeferredPromise>>&& promise)
 {
     if (promise && (!document() || !document()->isFullyActive())) {
-        promise.value()->reject(Exception { NotAllowedError, "Document is not fully active"_s });
+        promise.value()->reject(Exception { InvalidStateError, "Document is not fully active"_s });
         return;
     }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to