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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/constructor/panner.html

Issue 2536603003: Some PannerOptions dictionary members should be doubles (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webaudio/PannerOptions.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Test Constructor: Panner</title> 4 <title>Test Constructor: Panner</title>
5 <script src="../../resources/testharness.js"></script> 5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script> 6 <script src="../../resources/testharnessreport.js"></script>
7 <script src="../resources/audio-testing.js"></script> 7 <script src="../resources/audio-testing.js"></script>
8 </head> 8 </head>
9 9
10 <body> 10 <body>
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 "were not correctly handled"); 242 "were not correctly handled");
243 243
244 taskDone(); 244 taskDone();
245 }); 245 });
246 246
247 audit.defineTask("constructor with options", function (taskDone) { 247 audit.defineTask("constructor with options", function (taskDone) {
248 var node; 248 var node;
249 var success = true; 249 var success = true;
250 var options = { 250 var options = {
251 panningModel: "HRTF", 251 panningModel: "HRTF",
252 positionX: 3, 252 // We use full double float values here to verify also that the actual
253 positionY: 4, 253 // AudioParam value is properly rounded to a float. The actual value
254 positionZ: 5, 254 // is immaterial as long as x != Math.fround(x).
255 orientationX: -3, 255 positionX: Math.SQRT2,
256 orientationY: -4, 256 positionY: 2 * Math.SQRT2,
257 orientationZ: -5, 257 positionZ: 3 * Math.SQRT2,
258 orientationX: -Math.SQRT2,
259 orientationY: -2 * Math.SQRT2,
260 orientationZ: -3 * Math.SQRT2,
258 distanceModel: "linear", 261 distanceModel: "linear",
259 refDistance: 42, 262 // We use full double float values here to verify also that the actual
260 maxDistance: 99, 263 // attribute is a double float. The actual value is immaterial as
261 rolloffFactor: .25, 264 // long as x != Math.fround(x).
262 coneInnerAngle: 10, 265 refDistance: Math.PI,
263 coneOuterAngle: 50, 266 maxDistance: 2 * Math.PI,
264 coneOuterGain: .25 267 rolloffFactor: 3 * Math.PI,
268 coneInnerAngle: 4 * Math.PI,
269 coneOuterAngle: 5 * Math.PI,
270 coneOuterGain: 6 * Math.PI
265 }; 271 };
266 272
267 success = Should("node = new PannerNode(c, " + JSON.stringify(options) + ")", function () { 273 success = Should("node = new PannerNode(c, " + JSON.stringify(options) + ")", function () {
268 node = new PannerNode(context, options); 274 node = new PannerNode(context, options);
269 }).notThrow(); 275 }).notThrow();
270 success = Should("node instanceof PannerNode", node instanceof PannerNod e) 276 success = Should("node instanceof PannerNode", node instanceof PannerNod e)
271 .beEqualTo(true) && success; 277 .beEqualTo(true) && success;
272 278
273 success = Should("node.panningModel", node.panningModel) 279 success = Should("node.panningModel", node.panningModel)
274 .beEqualTo(options.panningModel) && success; 280 .beEqualTo(options.panningModel) && success;
275 success = Should("node.positionX.value", node.positionX.value) 281 success = Should("node.positionX.value", node.positionX.value)
276 .beEqualTo(options.positionX) && success; 282 .beEqualTo(Math.fround(options.positionX)) && success;
277 success = Should("node.positionY.value", node.positionY.value) 283 success = Should("node.positionY.value", node.positionY.value)
278 .beEqualTo(options.positionY) && success; 284 .beEqualTo(Math.fround(options.positionY)) && success;
279 success = Should("node.positionZ.value", node.positionZ.value) 285 success = Should("node.positionZ.value", node.positionZ.value)
280 .beEqualTo(options.positionZ) && success; 286 .beEqualTo(Math.fround(options.positionZ)) && success;
281 success = Should("node.orientationX.value", node.orientationX.value) 287 success = Should("node.orientationX.value", node.orientationX.value)
282 .beEqualTo(options.orientationX) && success; 288 .beEqualTo(Math.fround(options.orientationX)) && success;
283 success = Should("node.orientationY.value", node.orientationY.value) 289 success = Should("node.orientationY.value", node.orientationY.value)
284 .beEqualTo(options.orientationY) && success; 290 .beEqualTo(Math.fround(options.orientationY)) && success;
285 success = Should("node.orientationZ.value", node.orientationZ.value) 291 success = Should("node.orientationZ.value", node.orientationZ.value)
286 .beEqualTo(options.orientationZ) && success; 292 .beEqualTo(Math.fround(options.orientationZ)) && success;
287 success = Should("node.distanceModel", node.distanceModel) 293 success = Should("node.distanceModel", node.distanceModel)
288 .beEqualTo(options.distanceModel) && success; 294 .beEqualTo(options.distanceModel) && success;
289 success = Should("node.refDistance", node.refDistance) 295 success = Should("node.refDistance", node.refDistance)
290 .beEqualTo(options.refDistance) && success; 296 .beEqualTo(options.refDistance) && success;
291 success = Should("node.maxDistance", node.maxDistance) 297 success = Should("node.maxDistance", node.maxDistance)
292 .beEqualTo(options.maxDistance) && success; 298 .beEqualTo(options.maxDistance) && success;
293 success = Should("node.rolloffFactor", node.rolloffFactor) 299 success = Should("node.rolloffFactor", node.rolloffFactor)
294 .beEqualTo(options.rolloffFactor) && success; 300 .beEqualTo(options.rolloffFactor) && success;
295 success = Should("node.coneInnerAngle", node.coneInnerAngle) 301 success = Should("node.coneInnerAngle", node.coneInnerAngle)
296 .beEqualTo(options.coneInnerAngle) && success; 302 .beEqualTo(options.coneInnerAngle) && success;
(...skipping 14 matching lines...) Expand all
311 "constructed with correct attributes", 317 "constructed with correct attributes",
312 "was not constructed correctly"); 318 "was not constructed correctly");
313 319
314 taskDone(); 320 taskDone();
315 }); 321 });
316 322
317 audit.runTasks(); 323 audit.runTasks();
318 </script> 324 </script>
319 </body> 325 </body>
320 </html> 326 </html>
OLDNEW
« 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