From c41b2d4368849f8f747e1c82586447cbafd5a0c2 Mon Sep 17 00:00:00 2001 From: Paul Adenot Date: Fri, 7 Jun 2013 20:06:40 +0200 Subject: [PATCH] Bug 878875 - Port Blink's LayoutTest for PannerNode to mochitest-plain. r=ehsan --- content/media/webaudio/test/Makefile.in | 2 ++ content/media/webaudio/test/blink/Makefile.in | 19 +++++++++++++++ .../webaudio/test/blink/panner-model-testing.js | 4 ++-- content/media/webaudio/test/layouttest-glue.js | 15 ++++++++++++ content/media/webaudio/test/moz.build | 2 ++ .../webaudio/test/test_pannerNode_equalPower.html | 28 ++++++++++++++++++++++ 6 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 content/media/webaudio/test/blink/Makefile.in create mode 100644 content/media/webaudio/test/layouttest-glue.js create mode 100644 content/media/webaudio/test/test_pannerNode_equalPower.html diff --git a/content/media/webaudio/test/Makefile.in b/content/media/webaudio/test/Makefile.in index a18b04880857..820dfb09e7c0 100644 --- a/content/media/webaudio/test/Makefile.in +++ b/content/media/webaudio/test/Makefile.in @@ -12,6 +12,7 @@ include $(DEPTH)/config/autoconf.mk MOCHITEST_FILES := \ webaudio.js \ + layouttest-glue.js \ test_bug808374.html \ test_bug827541.html \ test_bug839753.html \ @@ -67,6 +68,7 @@ MOCHITEST_FILES := \ test_offlineDestinationChannelCountLess.html \ test_offlineDestinationChannelCountMore.html \ test_pannerNode.html \ + test_pannerNode_equalPower.html \ test_scriptProcessorNode.html \ test_scriptProcessorNodeChannelCount.html \ test_scriptProcessorNodeZeroInputOutput.html \ diff --git a/content/media/webaudio/test/blink/Makefile.in b/content/media/webaudio/test/blink/Makefile.in new file mode 100644 index 000000000000..68b0f1db37a9 --- /dev/null +++ b/content/media/webaudio/test/blink/Makefile.in @@ -0,0 +1,19 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +DEPTH := @DEPTH@ +topsrcdir := @top_srcdir@ +srcdir := @srcdir@ +VPATH := @srcdir@ +relativesrcdir := @relativesrcdir@ + +include $(DEPTH)/config/autoconf.mk + +MOCHITEST_FILES := \ + panner-model-testing.js \ + audio-testing.js \ + $(NULL) + +include $(topsrcdir)/config/rules.mk + diff --git a/content/media/webaudio/test/blink/panner-model-testing.js b/content/media/webaudio/test/blink/panner-model-testing.js index 598549eccd8d..c021ee52de2a 100644 --- a/content/media/webaudio/test/blink/panner-model-testing.js +++ b/content/media/webaudio/test/blink/panner-model-testing.js @@ -1,4 +1,4 @@ -var sampleRate = 44100.0; +var sampleRate = 48000.0; var numberOfChannels = 1; @@ -191,7 +191,7 @@ function checkResult(event) { testFailed("Left channel gain values are incorrect. Max error = " + maxErrorL + " at time " + time[maxErrorIndexL] + " (threshold = " + maxAllowedError + ")"); success = false; } - + if (maxErrorR <= maxAllowedError) { testPassed("Right channel gain values are correct."); } else { diff --git a/content/media/webaudio/test/layouttest-glue.js b/content/media/webaudio/test/layouttest-glue.js new file mode 100644 index 000000000000..392dfd4a4e0d --- /dev/null +++ b/content/media/webaudio/test/layouttest-glue.js @@ -0,0 +1,15 @@ +// Reimplementation of the LayoutTest API from Blink so we can easily port +// WebAudio tests to Simpletest, without touching the internals of the test. + +function testFailed(msg) { + ok(false, msg); +} + +function testPassed(msg) { + ok(true, msg); +} + +function finishJSTest() { + SimpleTest.finish(); +} + diff --git a/content/media/webaudio/test/moz.build b/content/media/webaudio/test/moz.build index c271ec3908ce..a1b94f597d18 100644 --- a/content/media/webaudio/test/moz.build +++ b/content/media/webaudio/test/moz.build @@ -3,3 +3,5 @@ # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. + +PARALLEL_DIRS += ['blink'] diff --git a/content/media/webaudio/test/test_pannerNode_equalPower.html b/content/media/webaudio/test/test_pannerNode_equalPower.html new file mode 100644 index 000000000000..ad28771d9f55 --- /dev/null +++ b/content/media/webaudio/test/test_pannerNode_equalPower.html @@ -0,0 +1,28 @@ + + + +Test PannerNode + + + + + + + + +
+
+
+ + -- 2.11.4.GIT