Title: [106611] trunk/LayoutTests
- Revision
- 106611
- Author
- [email protected]
- Date
- 2012-02-02 18:28:17 -0800 (Thu, 02 Feb 2012)
Log Message
Typo in sample-accurate-scheduling layout test?
https://bugs.webkit.org/show_bug.cgi?id=75996
Patch by Raymond Toy <[email protected]> on 2012-02-02
Reviewed by Kenneth Russell.
* webaudio/sample-accurate-scheduling-expected.txt: Updated
* webaudio/sample-accurate-scheduling.html: Fix typo, add test for
expected number of events.
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (106610 => 106611)
--- trunk/LayoutTests/ChangeLog 2012-02-03 02:13:25 UTC (rev 106610)
+++ trunk/LayoutTests/ChangeLog 2012-02-03 02:28:17 UTC (rev 106611)
@@ -1,5 +1,16 @@
2012-02-02 Raymond Toy <[email protected]>
+ Typo in sample-accurate-scheduling layout test?
+ https://bugs.webkit.org/show_bug.cgi?id=75996
+
+ Reviewed by Kenneth Russell.
+
+ * webaudio/sample-accurate-scheduling-expected.txt: Updated
+ * webaudio/sample-accurate-scheduling.html: Fix typo, add test for
+ expected number of events.
+
+2012-02-02 Raymond Toy <[email protected]>
+
Fix up test expectations for two tests that now pass.
https://bugs.webkit.org/show_bug.cgi?id=77256
Modified: trunk/LayoutTests/webaudio/sample-accurate-scheduling-expected.txt (106610 => 106611)
--- trunk/LayoutTests/webaudio/sample-accurate-scheduling-expected.txt 2012-02-03 02:13:25 UTC (rev 106610)
+++ trunk/LayoutTests/webaudio/sample-accurate-scheduling-expected.txt 2012-02-03 02:28:17 UTC (rev 106611)
@@ -2,6 +2,7 @@
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+PASS Expected number of events found.
PASS All events rendered with sample-accuracy.
PASS successfullyParsed is true
Modified: trunk/LayoutTests/webaudio/sample-accurate-scheduling.html (106610 => 106611)
--- trunk/LayoutTests/webaudio/sample-accurate-scheduling.html 2012-02-03 02:13:25 UTC (rev 106610)
+++ trunk/LayoutTests/webaudio/sample-accurate-scheduling.html 2012-02-03 02:28:17 UTC (rev 106611)
@@ -53,6 +53,8 @@
var bufferDataR = buffer.getChannelData(1);
var success = true;
+ var impulseCount = 0;
+ var badOffsetCount = false;
// Go through every sample and make sure it's 0, except at positions in sampleOffsets.
for (var i = 0; i < buffer.length; ++i) {
@@ -72,15 +74,27 @@
break;
}
}
-
+ ++impulseCount;
if (!found) {
- testFailed("Non-zero sample found at wrong sample offset.");
+ testFailed("Non-zero sample found at sample offset " + i);
success = false;
- break;
+ ++badOffsetCount;
}
}
}
+ if (impulseCount == sampleOffsets.length) {
+ if (badOffsetCount == 0) {
+ testPassed("Expected number of events found.");
+ } else {
+ testFailed("Expected number of events found, but " + badOffsetCount + " are at incorrect offsets.");
+ success = false;
+ }
+ } else {
+ testFailed("Expected " + sampleOffsets.length + " impulses but only found " + impulseCount);
+ success = false;
+ }
+
if (success) {
testPassed("All events rendered with sample-accuracy.");
} else {
@@ -103,7 +117,7 @@
createImpulse();
for (var i = 0; i < sampleOffsets.length; ++i) {
- var timeInSeconds = sampleOffsets[i] * sampleRate;
+ var timeInSeconds = sampleOffsets[i] / sampleRate;
playNote(timeInSeconds);
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes