Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Unified Diff: third_party/WebKit/LayoutTests/webaudio/constructor/panner.html

Issue 2536603003: Some PannerOptions dictionary members should be doubles (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webaudio/PannerOptions.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/webaudio/constructor/panner.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/constructor/panner.html b/third_party/WebKit/LayoutTests/webaudio/constructor/panner.html
index c55e156d1634c1a3db336920aa2fa44a0e703f86..fc57416546b3f1ab24f36e15aacf16c603a8c138 100644
--- a/third_party/WebKit/LayoutTests/webaudio/constructor/panner.html
+++ b/third_party/WebKit/LayoutTests/webaudio/constructor/panner.html
@@ -249,19 +249,25 @@
var success = true;
var options = {
panningModel: "HRTF",
- positionX: 3,
- positionY: 4,
- positionZ: 5,
- orientationX: -3,
- orientationY: -4,
- orientationZ: -5,
+ // We use full double float values here to verify also that the actual
+ // AudioParam value is properly rounded to a float. The actual value
+ // is immaterial as long as x != Math.fround(x).
+ positionX: Math.SQRT2,
+ positionY: 2 * Math.SQRT2,
+ positionZ: 3 * Math.SQRT2,
+ orientationX: -Math.SQRT2,
+ orientationY: -2 * Math.SQRT2,
+ orientationZ: -3 * Math.SQRT2,
distanceModel: "linear",
- refDistance: 42,
- maxDistance: 99,
- rolloffFactor: .25,
- coneInnerAngle: 10,
- coneOuterAngle: 50,
- coneOuterGain: .25
+ // We use full double float values here to verify also that the actual
+ // attribute is a double float. The actual value is immaterial as
+ // long as x != Math.fround(x).
+ refDistance: Math.PI,
+ maxDistance: 2 * Math.PI,
+ rolloffFactor: 3 * Math.PI,
+ coneInnerAngle: 4 * Math.PI,
+ coneOuterAngle: 5 * Math.PI,
+ coneOuterGain: 6 * Math.PI
};
success = Should("node = new PannerNode(c, " + JSON.stringify(options) + ")", function () {
@@ -273,17 +279,17 @@
success = Should("node.panningModel", node.panningModel)
.beEqualTo(options.panningModel) && success;
success = Should("node.positionX.value", node.positionX.value)
- .beEqualTo(options.positionX) && success;
+ .beEqualTo(Math.fround(options.positionX)) && success;
success = Should("node.positionY.value", node.positionY.value)
- .beEqualTo(options.positionY) && success;
+ .beEqualTo(Math.fround(options.positionY)) && success;
success = Should("node.positionZ.value", node.positionZ.value)
- .beEqualTo(options.positionZ) && success;
+ .beEqualTo(Math.fround(options.positionZ)) && success;
success = Should("node.orientationX.value", node.orientationX.value)
- .beEqualTo(options.orientationX) && success;
+ .beEqualTo(Math.fround(options.orientationX)) && success;
success = Should("node.orientationY.value", node.orientationY.value)
- .beEqualTo(options.orientationY) && success;
+ .beEqualTo(Math.fround(options.orientationY)) && success;
success = Should("node.orientationZ.value", node.orientationZ.value)
- .beEqualTo(options.orientationZ) && success;
+ .beEqualTo(Math.fround(options.orientationZ)) && success;
success = Should("node.distanceModel", node.distanceModel)
.beEqualTo(options.distanceModel) && success;
success = Should("node.refDistance", node.refDistance)
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webaudio/PannerOptions.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698