Title: [265684] trunk
Revision
265684
Author
[email protected]
Date
2020-08-14 11:39:15 -0700 (Fri, 14 Aug 2020)

Log Message

Make sure OfflineAudioContext::startOfflineRendering() does lazy initialization
https://bugs.webkit.org/show_bug.cgi?id=215481

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

Rebaseline WPT tests now that more checks are passing.

* web-platform-tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/active-processing.https-expected.txt:
* web-platform-tests/webaudio/the-audio-api/the-audioworklet-interface/audioworkletnode-channel-count.https-expected.txt:
* web-platform-tests/webaudio/the-audio-api/the-audioworklet-interface/suspended-context-messageport.https-expected.txt:
* web-platform-tests/webaudio/the-audio-api/the-offlineaudiocontext-interface/current-time-block-size-expected.txt:

Source/WebCore:

Make sure OfflineAudioContext::startOfflineRendering() does lazy initialization before
actually starting rendering. If lazy initialization has not happened yet (because no
audio nodes were created for this context yet), then rendering would fail with an
InvalidStateError, due to lack on initialization.

No new tests, rebaselined existing tests.

* Modules/webaudio/OfflineAudioContext.cpp:
(WebCore::OfflineAudioContext::startOfflineRendering):
* Modules/webaudio/OfflineAudioDestinationNode.cpp:
(WebCore::OfflineAudioDestinationNode::offlineRender):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (265683 => 265684)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2020-08-14 18:27:10 UTC (rev 265683)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2020-08-14 18:39:15 UTC (rev 265684)
@@ -1,5 +1,19 @@
 2020-08-14  Chris Dumez  <[email protected]>
 
+        Make sure OfflineAudioContext::startOfflineRendering() does lazy initialization
+        https://bugs.webkit.org/show_bug.cgi?id=215481
+
+        Reviewed by Eric Carlson.
+
+        Rebaseline WPT tests now that more checks are passing.
+
+        * web-platform-tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/active-processing.https-expected.txt:
+        * web-platform-tests/webaudio/the-audio-api/the-audioworklet-interface/audioworkletnode-channel-count.https-expected.txt:
+        * web-platform-tests/webaudio/the-audio-api/the-audioworklet-interface/suspended-context-messageport.https-expected.txt:
+        * web-platform-tests/webaudio/the-audio-api/the-offlineaudiocontext-interface/current-time-block-size-expected.txt:
+
+2020-08-14  Chris Dumez  <[email protected]>
+
         Fix bad check in AudioBufferSourceNode::renderFromBuffer()
         https://bugs.webkit.org/show_bug.cgi?id=215513
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/active-processing.https-expected.txt (265683 => 265684)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/active-processing.https-expected.txt	2020-08-14 18:27:10 UTC (rev 265683)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/active-processing.https-expected.txt	2020-08-14 18:39:15 UTC (rev 265684)
@@ -1,11 +1,22 @@
-CONSOLE MESSAGE: Unhandled Promise Rejection: InvalidStateError: The object is in an invalid state.
 
-Harness Error (FAIL), message = Unhandled rejection: The object is in an invalid state.
-
 PASS # AUDIT TASK RUNNER STARTED. 
 FAIL Executing "Setup graph" promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'context.audioWorklet.addModule')"
-TIMEOUT Executing "verify count change" Test timed out
-NOTRUN Audit report 
+PASS Executing "verify count change" 
+PASS Audit report 
 PASS > [Setup graph]  
 PASS > [verify count change]  
+FAIL X Number of channels changed is not true. Got false. assert_true: expected true got false
+PASS   Index where input channel count changed is less than or equal to 1280. 
+FAIL X Number of channels in input[0:-2]: Expected 7 for all values but found 1279 unexpected values: 
+	Index	Actual
+	[0]	0
+	[1]	0
+	[2]	0
+	[3]	0
+	...and 1275 more errors. assert_true: expected true got false
+FAIL X Number of channels in input[-1:]: Expected 1 for all values but found 1 unexpected values: 
+	Index	Actual
+	[0]	0 assert_true: expected true got false
+FAIL < [verify count change] 3 out of 4 assertions were failed. assert_true: expected true got false
+FAIL # AUDIT TASK RUNNER FINISHED: 1 out of 2 tasks were failed. assert_true: expected true got false
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audioworklet-interface/audioworkletnode-channel-count.https-expected.txt (265683 => 265684)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audioworklet-interface/audioworkletnode-channel-count.https-expected.txt	2020-08-14 18:27:10 UTC (rev 265683)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audioworklet-interface/audioworkletnode-channel-count.https-expected.txt	2020-08-14 18:39:15 UTC (rev 265684)
@@ -1,11 +1,34 @@
-CONSOLE MESSAGE: Unhandled Promise Rejection: InvalidStateError: The object is in an invalid state.
 
-Harness Error (FAIL), message = Unhandled rejection: The object is in an invalid state.
-
 PASS # AUDIT TASK RUNNER STARTED. 
 FAIL Executing "setup-buffer-and-worklet" promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'context.audioWorklet.addModule')"
-TIMEOUT Executing "verify-rendered-buffer" Test timed out
-NOTRUN Audit report 
+PASS Executing "verify-rendered-buffer" 
+PASS Audit report 
 PASS > [setup-buffer-and-worklet]  
 PASS > [verify-rendered-buffer]  
+PASS   First half of Channel #0 contains only the constant 0. 
+FAIL X Second half of Channel #0: Expected 1 for all values but found 128 unexpected values: 
+	Index	Actual
+	[0]	0
+	[1]	0
+	[2]	0
+	[3]	0
+	...and 124 more errors. assert_true: expected true got false
+PASS   First half of Channel #1 contains only the constant 0. 
+FAIL X Second half of Channel #1: Expected 2 for all values but found 128 unexpected values: 
+	Index	Actual
+	[0]	0
+	[1]	0
+	[2]	0
+	[3]	0
+	...and 124 more errors. assert_true: expected true got false
+PASS   First half of Channel #2 contains only the constant 0. 
+FAIL X Second half of Channel #2: Expected 3 for all values but found 128 unexpected values: 
+	Index	Actual
+	[0]	0
+	[1]	0
+	[2]	0
+	[3]	0
+	...and 124 more errors. assert_true: expected true got false
+FAIL < [verify-rendered-buffer] 3 out of 6 assertions were failed. assert_true: expected true got false
+FAIL # AUDIT TASK RUNNER FINISHED: 1 out of 2 tasks were failed. assert_true: expected true got false
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audioworklet-interface/suspended-context-messageport.https-expected.txt (265683 => 265684)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audioworklet-interface/suspended-context-messageport.https-expected.txt	2020-08-14 18:27:10 UTC (rev 265683)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audioworklet-interface/suspended-context-messageport.https-expected.txt	2020-08-14 18:39:15 UTC (rev 265684)
@@ -1,5 +1,5 @@
 
 FAIL realtime suspended promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'realtime.audioWorklet.addModule')"
 FAIL offline before start promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'offline.audioWorklet.addModule')"
-FAIL offline on complete promise_test: Unhandled rejection with value: object "InvalidStateError: The object is in an invalid state."
+FAIL offline on complete promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: AudioWorkletNode"
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-offlineaudiocontext-interface/current-time-block-size-expected.txt (265683 => 265684)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-offlineaudiocontext-interface/current-time-block-size-expected.txt	2020-08-14 18:27:10 UTC (rev 265683)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-offlineaudiocontext-interface/current-time-block-size-expected.txt	2020-08-14 18:39:15 UTC (rev 265684)
@@ -1,3 +1,3 @@
 
-FAIL Test currentTime at completion of OfflineAudioContext rendering promise_test: Unhandled rejection with value: object "InvalidStateError: The object is in an invalid state."
+PASS Test currentTime at completion of OfflineAudioContext rendering 
 

Modified: trunk/Source/WebCore/ChangeLog (265683 => 265684)


--- trunk/Source/WebCore/ChangeLog	2020-08-14 18:27:10 UTC (rev 265683)
+++ trunk/Source/WebCore/ChangeLog	2020-08-14 18:39:15 UTC (rev 265684)
@@ -1,5 +1,24 @@
 2020-08-14  Chris Dumez  <[email protected]>
 
+        Make sure OfflineAudioContext::startOfflineRendering() does lazy initialization
+        https://bugs.webkit.org/show_bug.cgi?id=215481
+
+        Reviewed by Eric Carlson.
+
+        Make sure OfflineAudioContext::startOfflineRendering() does lazy initialization before
+        actually starting rendering. If lazy initialization has not happened yet (because no
+        audio nodes were created for this context yet), then rendering would fail with an
+        InvalidStateError, due to lack on initialization.
+
+        No new tests, rebaselined existing tests.
+
+        * Modules/webaudio/OfflineAudioContext.cpp:
+        (WebCore::OfflineAudioContext::startOfflineRendering):
+        * Modules/webaudio/OfflineAudioDestinationNode.cpp:
+        (WebCore::OfflineAudioDestinationNode::offlineRender):
+
+2020-08-14  Chris Dumez  <[email protected]>
+
         Fix bad check in AudioBufferSourceNode::renderFromBuffer()
         https://bugs.webkit.org/show_bug.cgi?id=215513
 

Modified: trunk/Source/WebCore/Modules/webaudio/OfflineAudioContext.cpp (265683 => 265684)


--- trunk/Source/WebCore/Modules/webaudio/OfflineAudioContext.cpp	2020-08-14 18:27:10 UTC (rev 265683)
+++ trunk/Source/WebCore/Modules/webaudio/OfflineAudioContext.cpp	2020-08-14 18:39:15 UTC (rev 265684)
@@ -74,6 +74,8 @@
         return;
     }
 
+    lazyInitialize();
+
     auto result = destination()->startRendering();
     if (result.hasException()) {
         promise->reject(result.releaseException());

Modified: trunk/Source/WebCore/Modules/webaudio/OfflineAudioDestinationNode.cpp (265683 => 265684)


--- trunk/Source/WebCore/Modules/webaudio/OfflineAudioDestinationNode.cpp	2020-08-14 18:27:10 UTC (rev 265683)
+++ trunk/Source/WebCore/Modules/webaudio/OfflineAudioDestinationNode.cpp	2020-08-14 18:39:15 UTC (rev 265684)
@@ -108,11 +108,7 @@
     if (!m_renderBus.get())
         return false;
 
-    bool isAudioContextInitialized = context().isInitialized();
-    // FIXME: We used to assert that isAudioContextInitialized is true here.
-    // But it's trivially false in imported/w3c/web-platform-tests/webaudio/the-audio-api/the-offlineaudiocontext-interface/current-time-block-size.html 
-    if (!isAudioContextInitialized)
-        return false;
+    RELEASE_ASSERT(context().isInitialized());
 
     bool channelsMatch = m_renderBus->numberOfChannels() == m_renderTarget->numberOfChannels();
     ASSERT(channelsMatch);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to