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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/AudioBuffer/audiobuffer-getChannelData.html

Issue 2593083002: Convert AudioBuffer Audit tests to testharness (Closed)
Patch Set: Rebase Created 3 years, 12 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
Index: third_party/WebKit/LayoutTests/webaudio/AudioBuffer/audiobuffer-getChannelData.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioBuffer/audiobuffer-getChannelData.html b/third_party/WebKit/LayoutTests/webaudio/AudioBuffer/audiobuffer-getChannelData.html
index 1c9ba36a25382169885c2c4ed9219dc00f947d18..a6a7a2d18b8012c00c5e612a601e0595720f93ea 100644
--- a/third_party/WebKit/LayoutTests/webaudio/AudioBuffer/audiobuffer-getChannelData.html
+++ b/third_party/WebKit/LayoutTests/webaudio/AudioBuffer/audiobuffer-getChannelData.html
@@ -1,7 +1,8 @@
<!doctype html>
<html>
<head>
- <script src="../../resources/js-test.js"></script>
+ <script src="../../resources/testharness.js"></script>
+ <script src="../../resources/testharnessreport.js"></script>
<script src="../resources/audit-util.js"></script>
<script src="../resources/audio-testing.js"></script>
<script src="../resources/audioparam-testing.js"></script>
@@ -10,8 +11,6 @@
<body>
<script>
- description("Test AudioBuffer.getChannelData() Returns the Same Object");
- window.jsTestIsAsync = true;
var sampleRate = 48000;
var renderDuration = 0.5;
@@ -29,21 +28,17 @@
for (var c = 0; c < channelCount; ++c) {
var a = buffer.getChannelData(c);
var b = buffer.getChannelData(c);
- testPassed("a = buffer.getChannelData(" + c + ")");
- testPassed("b = buffer.getChannelData(" + c + ")");
-
- if (a === b) {
- testPassed("a === b is true");
- } else {
- testFailed("a === b is false");
- success = false;
- }
+ //testPassed("a = buffer.getChannelData(" + c + ")");
+ //testPassed("b = buffer.getChannelData(" + c + ")");
+
+ let message = "buffer.getChannelData(" + c + ")";
+ success = Should(message + " === "+ message, a === b)
+ .beEqualTo(true) && success;
}
- if (success)
- testPassed("getChannelData correctly returned the same buffer.\n")
- else
- testFailed("getChannelData inccorrectly returned the different buffers.\n")
+ Should("getChannelData", success)
+ .summarize("correctly returned the same buffer",
+ "inccorrectly returned the different buffers");
done();
});
@@ -58,26 +53,22 @@
for (var c = 0; c < channelCount; ++c) {
var a = buffer1.getChannelData(c);
var b = buffer2.getChannelData(c);
- testPassed("a = buffer1.getChannelData(" + c + ")");
- testPassed("b = buffer2.getChannelData(" + c + ")");
-
- if (a === b) {
- testFailed("a === b is true");
- success = false;
- } else {
- testPassed("a === b is false");
- }
+ //testPassed("a = buffer1.getChannelData(" + c + ")");
+ //testPassed("b = buffer2.getChannelData(" + c + ")");
+
+ let message = "getChannelData(" + c + ")";
+ success = Should("buffer1." + message + " === buffer2." + message,
+ a === b)
+ .beEqualTo(false) && success;
}
- if (success)
- testPassed("getChannelData correctly returned different buffers.\n")
- else
- testFailed("getChannelData incorrectly returned the same buffers.\n")
+ Should("getChannelData", success)
+ .summarize("correctly returned different buffers",
+ "incorrectly returned the same buffers");
done();
});
audit.defineTask("finish", function (done) {
- finishJSTest();
done();
});

Powered by Google App Engine
This is Rietveld 408576698