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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/Panner/panner-distance-clamping.html

Issue 2807313002: Allow Panner.refDistance to be 0 (Closed)
Patch Set: Adjust test to support cases where 0 is allowed (or not) Created 3 years, 8 months 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/PannerNode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/webaudio/Panner/panner-distance-clamping.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/Panner/panner-distance-clamping.html b/third_party/WebKit/LayoutTests/webaudio/Panner/panner-distance-clamping.html
index 2a64972ab59f0259d6376c9f8a50f64bd238f7b1..585f8aff10d3ebc9748afb6c8ce364901524f011 100644
--- a/third_party/WebKit/LayoutTests/webaudio/Panner/panner-distance-clamping.html
+++ b/third_party/WebKit/LayoutTests/webaudio/Panner/panner-distance-clamping.html
@@ -17,12 +17,12 @@
var audit = Audit.createTaskRunner();
audit.defineTask("ref-distance-error", function (taskDone) {
- testDistanceLimits({name: "refDistance"});
+ testDistanceLimits({name: "refDistance", isZeroAllowed: true});
taskDone();
});
audit.defineTask("max-distance-error", function (taskDone) {
- testDistanceLimits({name: "maxDistance"});
+ testDistanceLimits({name: "maxDistance", isZeroAllowed: false});
taskDone();
});
@@ -39,11 +39,19 @@
new PannerNode(context, nodeOptions);
}).throw("RangeError");
- success = Should(prefix + "0})", function () {
- var nodeOptions = {};
- nodeOptions[attrName] = 0;
- new PannerNode(context, nodeOptions);
- }).throw("RangeError") && success;
+ if (options.isZeroAllowed) {
+ success = Should(prefix + "0})", function () {
+ var nodeOptions = {};
+ nodeOptions[attrName] = 0;
+ new PannerNode(context, nodeOptions);
+ }).notThrow() && success;
+ } else {
+ success = Should(prefix + "0})", function () {
+ var nodeOptions = {};
+ nodeOptions[attrName] = 0;
+ new PannerNode(context, nodeOptions);
+ }).throw("RangeError") && success;
+ }
// The smallest representable positive single float.
var leastPositiveDoubleFloat = 4.9406564584124654e-324;
@@ -61,9 +69,15 @@
panner[attrName] = -1;
}).throw("RangeError") && success;
- success = Should(prefix + "0", function () {
- panner[attrName] = 0;
- }).throw("RangeError") && success;
+ if (options.isZeroAllowed) {
+ success = Should(prefix + "0", function () {
+ panner[attrName] = 0;
+ }).notThrow() && success;
+ } else {
+ success = Should(prefix + "0", function () {
+ panner[attrName] = 0;
+ }).throw("RangeError") && success;
+ }
success = Should(prefix + leastPositiveDoubleFloat, function () {
panner[attrName] = leastPositiveDoubleFloat;
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webaudio/PannerNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698