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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiosource-onended.html

Issue 2783553002: Convert AudioBufferSource tests to new Audit (Closed)
Patch Set: Indent neatly. 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
Index: third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiosource-onended.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiosource-onended.html b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiosource-onended.html
index f5b0e3f5c75be9e0110a4be1266342298cb91041..7191e71dd888ec3f9967b9011692b6cb889abfb5 100644
--- a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiosource-onended.html
+++ b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiosource-onended.html
@@ -5,7 +5,7 @@
<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/audit.js"></script>
</head>
<body>
@@ -22,7 +22,7 @@
var audit = Audit.createTaskRunner();
- audit.defineTask("absn-set-onended", function (done) {
+ audit.define("absn-set-onended", (task, should) => {
// Test that the onended event for an AudioBufferSourceNode is fired when it is set
// directly.
var context = new OfflineAudioContext(1, renderLengthFrames, sampleRate);
@@ -31,63 +31,66 @@
source.buffer = buffer;
source.connect(context.destination);
source.onended = function (e) {
- Should("AudioBufferSource.onended called when ended set directly", true)
+ should(true, "AudioBufferSource.onended called when ended set directly")
.beEqualTo(true);
};
source.start();
- context.startRendering().then(done);
+ context.startRendering().then(() => task.done());
});
- audit.defineTask("absn-add-listener", function (done) {
+ audit.define("absn-add-listener", (task, should) => {
// Test that the onended event for an AudioBufferSourceNode is fired when
// addEventListener is used to set the handler.
- var context = new OfflineAudioContext(1, renderLengthFrames, sampleRate);
- var buffer = context.createBuffer(1, sourceBufferLengthFrames, context.sampleRate);
+ var context = new OfflineAudioContext(1, renderLengthFrames,
+ sampleRate);
+ var buffer = context.createBuffer(1, sourceBufferLengthFrames,
+ context.sampleRate);
var source = context.createBufferSource();
source.buffer = buffer;
source.connect(context.destination);
source.addEventListener("ended", function (e) {
- Should("AudioBufferSource.onended called when using addEventListener",
- true).beEqualTo(true);
+ should(true,
+ "AudioBufferSource.onended called when using addEventListener"
+ )
+ .beEqualTo(true);
});
source.start();
- context.startRendering().then(done);
+ context.startRendering().then(() => task.done());
});
- audit.defineTask("osc-set-onended", function (done) {
+ audit.define("osc-set-onended", (task, should) => {
// Test that the onended event for an OscillatorNode is fired when it is set
// directly.
var context = new OfflineAudioContext(1, renderLengthFrames, sampleRate);
var source = context.createOscillator();
source.connect(context.destination);
source.onended = function (e) {
- Should("Oscillator.onended called when ended set directly", true).beEqualTo(true);
+ should(true, "Oscillator.onended called when ended set directly")
+ .beEqualTo(true);
};
source.start();
source.stop(stopTime);
- context.startRendering().then(done);
+ context.startRendering().then(() => task.done());
});
- audit.defineTask("osc-add-listener", function (done) {
+ audit.define("osc-add-listener", (task, should) => {
// Test that the onended event for an OscillatorNode is fired when
// addEventListener is used to set the handler.
- var context = new OfflineAudioContext(1, renderLengthFrames, sampleRate);
+ var context = new OfflineAudioContext(1, renderLengthFrames,
+ sampleRate);
var source = context.createOscillator();
source.connect(context.destination);
source.addEventListener("ended", function (e) {
- Should("Oscillator.onended called when using addEventListener", true).beEqualTo(true);
+ should(true,
+ "Oscillator.onended called when using addEventListener")
+ .beEqualTo(true);
});
source.start();
source.stop(stopTime);
- context.startRendering().then(done);
- });
-
- audit.defineTask("finish", function (done) {
- done();
+ context.startRendering().then(() => task.done());
});
- audit.runTasks();
- succesfullyParsed = true;
+ audit.run();
</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698