Title: [274794] trunk
Revision
274794
Author
[email protected]
Date
2021-03-22 13:51:51 -0700 (Mon, 22 Mar 2021)

Log Message

imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audioparam-interface/nan-param.html is failing
https://bugs.webkit.org/show_bug.cgi?id=223583

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

Rebaseline test that is now passing.

* web-platform-tests/webaudio/the-audio-api/the-audioparam-interface/nan-param-expected.txt:

Source/WebCore:

As per https://webaudio.github.io/web-audio-api/#computation-of-value, we should replace NaN values with
the default value, when computing the value for an AudioParam.

No new tests, rebaselined existing test.

* Modules/webaudio/AudioParam.cpp:
(WebCore::replaceNaNValues):
(WebCore::AudioParam::calculateFinalValues):

LayoutTests:

Unskip test that should no longer be flaky.

* TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (274793 => 274794)


--- trunk/LayoutTests/ChangeLog	2021-03-22 20:51:10 UTC (rev 274793)
+++ trunk/LayoutTests/ChangeLog	2021-03-22 20:51:51 UTC (rev 274794)
@@ -1,3 +1,14 @@
+2021-03-22  Chris Dumez  <[email protected]>
+
+        imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audioparam-interface/nan-param.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=223583
+
+        Reviewed by Eric Carlson.
+
+        Unskip test that should no longer be flaky.
+
+        * TestExpectations:
+
 2021-03-22  Rob Buis  <[email protected]>
 
         [css-contain] Parse CSS contain property

Modified: trunk/LayoutTests/TestExpectations (274793 => 274794)


--- trunk/LayoutTests/TestExpectations	2021-03-22 20:51:10 UTC (rev 274793)
+++ trunk/LayoutTests/TestExpectations	2021-03-22 20:51:51 UTC (rev 274794)
@@ -346,9 +346,6 @@
 # Skip WPT webaudio tests that are timing out.
 imported/w3c/web-platform-tests/webaudio/the-audio-api/the-mediastreamaudiosourcenode-interface/mediastreamaudiosourcenode-routing.html [ Skip ]
 
-# Test has been failing and flaky since its import.
-imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audioparam-interface/nan-param.html [ Failure Pass ]
-
 # This test is timing out due to lack of support for SharedArrayBuffer.
 imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audioworklet-interface/audioworklet-postmessage-sharedarraybuffer.https.html [ Skip ]
 

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (274793 => 274794)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-03-22 20:51:10 UTC (rev 274793)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-03-22 20:51:51 UTC (rev 274794)
@@ -1,3 +1,14 @@
+2021-03-22  Chris Dumez  <[email protected]>
+
+        imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audioparam-interface/nan-param.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=223583
+
+        Reviewed by Eric Carlson.
+
+        Rebaseline test that is now passing.
+
+        * web-platform-tests/webaudio/the-audio-api/the-audioparam-interface/nan-param-expected.txt:
+
 2021-03-22  Rob Buis  <[email protected]>
 
         [css-contain] Parse CSS contain property

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audioparam-interface/nan-param-expected.txt (274793 => 274794)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audioparam-interface/nan-param-expected.txt	2021-03-22 20:51:10 UTC (rev 274793)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audioparam-interface/nan-param-expected.txt	2021-03-22 20:51:51 UTC (rev 274794)
@@ -4,13 +4,7 @@
 PASS Audit report
 PASS > [AudioParam NaN]
 PASS   AudioParam input contains only NaN is true.
-FAIL X AudioParam output: Expected 100 for all values but found 256 unexpected values:
-	Index	Actual
-	[0]	-3.402823e+38
-	[1]	-3.402823e+38
-	[2]	-3.402823e+38
-	[3]	-3.402823e+38
-	...and 252 more errors. assert_true: expected true got false
-FAIL < [AudioParam NaN] 1 out of 2 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   AudioParam output contains only the constant 100.
+PASS < [AudioParam NaN] All assertions passed. (total 2 assertions)
+PASS # AUDIT TASK RUNNER FINISHED: 1 tasks ran successfully.
 

Modified: trunk/Source/WebCore/ChangeLog (274793 => 274794)


--- trunk/Source/WebCore/ChangeLog	2021-03-22 20:51:10 UTC (rev 274793)
+++ trunk/Source/WebCore/ChangeLog	2021-03-22 20:51:51 UTC (rev 274794)
@@ -1,3 +1,19 @@
+2021-03-22  Chris Dumez  <[email protected]>
+
+        imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audioparam-interface/nan-param.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=223583
+
+        Reviewed by Eric Carlson.
+
+        As per https://webaudio.github.io/web-audio-api/#computation-of-value, we should replace NaN values with
+        the default value, when computing the value for an AudioParam.
+
+        No new tests, rebaselined existing test.
+
+        * Modules/webaudio/AudioParam.cpp:
+        (WebCore::replaceNaNValues):
+        (WebCore::AudioParam::calculateFinalValues):
+
 2021-03-22  Rob Buis  <[email protected]>
 
         [css-contain] Parse CSS contain property

Modified: trunk/Source/WebCore/Modules/webaudio/AudioParam.cpp (274793 => 274794)


--- trunk/Source/WebCore/Modules/webaudio/AudioParam.cpp	2021-03-22 20:51:10 UTC (rev 274793)
+++ trunk/Source/WebCore/Modules/webaudio/AudioParam.cpp	2021-03-22 20:51:51 UTC (rev 274794)
@@ -39,6 +39,14 @@
 
 namespace WebCore {
 
+static void replaceNaNValues(float* values, unsigned numberOfValues, float defaultValue)
+{
+    for (unsigned i = 0; i < numberOfValues; ++i) {
+        if (std::isnan(values[i]))
+            values[i] = defaultValue;
+    }
+}
+
 AudioParam::AudioParam(BaseAudioContext& context, const String& name, float defaultValue, float minValue, float maxValue, AutomationRate automationRate, AutomationRateMode automationRateMode)
     : AudioSummingJunction(context)
     , m_name(name)
@@ -295,6 +303,10 @@
     if (!sampleAccurate)
         std::fill_n(values + 1, numberOfValues - 1, values[0]);
 
+    // As per https://webaudio.github.io/web-audio-api/#computation-of-value, we should replace NaN values
+    // with the default value.
+    replaceNaNValues(values, numberOfValues, m_defaultValue);
+
     // Clamp values based on range allowed by AudioParam's min and max values.
     VectorMath::clamp(values, minValue(), maxValue(), values, numberOfValues);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to