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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/OfflineAudioContext/offlineaudiocontext-promise-basic.html

Issue 2676343003: Convert OfflineAudioContext Audit tests to testharness (Closed)
Patch Set: Created 3 years, 10 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/OfflineAudioContext/offlineaudiocontext-promise-basic.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/OfflineAudioContext/offlineaudiocontext-promise-basic.html b/third_party/WebKit/LayoutTests/webaudio/OfflineAudioContext/offlineaudiocontext-promise-basic.html
index d3aa1625b6753fc1479aa03a4a1eccc8bb61473a..0e85485520b9051ff7fc1e6bef0cb6fbdac12a7f 100644
--- a/third_party/WebKit/LayoutTests/webaudio/OfflineAudioContext/offlineaudiocontext-promise-basic.html
+++ b/third_party/WebKit/LayoutTests/webaudio/OfflineAudioContext/offlineaudiocontext-promise-basic.html
@@ -1,16 +1,16 @@
<!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/audio-testing.js"></script>
<title>OfflineAudioContext.startRendering Promise</title>
</head>
<body>
<script>
- description("Test OfflineAudioContext.startRendering Promise")
+// description("Test OfflineAudioContext.startRendering Promise")
hongchan 2017/02/07 18:26:15 Remove this line.
Raymond Toy 2017/02/14 16:27:57 Done.
- window.jsTestIsAsync = true;
var context;
var promiseData;
@@ -27,13 +27,10 @@
// promise.
var context = new OfflineAudioContext(contextChannels, renderFrames, sampleRate);
context.startRendering();
- context.startRendering()
- .then(function () {
- testFailed("Promise not rejected when calling startRendering twice");
- }, function () {
- testPassed("Promise correctly rejected when calling startRendering twice");
- })
- .then(done);
+ Should('Promise from calling startRendering twice',
+ context.startRendering())
+ .beRejected()
+ .then(done);
});
audit.defineTask('promise-results', function (done) {
@@ -57,7 +54,6 @@
audit.defineTask('finish', function (done) {
done();
hongchan 2017/02/07 18:26:15 I think we can remove this task because we don't n
Raymond Toy 2017/02/14 16:27:57 Done.
- finishJSTest();
});
audit.runTasks('reject-promise', 'promise-results', 'finish');
@@ -67,9 +63,12 @@
renderedData = buffer;
var success = true;
- shouldBeEqualToString("context.state", "closed");
- shouldBeEqualToNumber("renderedData.numberOfChannels", contextChannels);
- shouldBeEqualToNumber("renderedData.length", renderFrames);
+ Should("context.state", context.state)
+ .beEqualTo("closed");
+ Should("renderedData.numberOfChannels", renderedData.numberOfChannels)
+ .beEqualTo(contextChannels);
+ Should("renderedData.length", renderedData.length)
+ .beEqualTo(renderFrames);
for (var channel = 0; channel < contextChannels; ++channel) {
var data = renderedData.getChannelData(channel);
@@ -85,14 +84,9 @@
break;
}
- if (success) {
- testPassed("Rendered data matches expected results");
- testPassed("OfflineAudioContext.startRendering promise succeeded");
- } else {
- testFailed("Rendered data does not match expected results for channel " +
- badChannel + ", frame " + badFrame);
- testFailed("OfflineAudioContext.startRendering promise");
- }
+ Should('OfflineAudioContext.startRendering promise rendered data',
+ success)
+ .summarize('correctly', 'incorrectly');
}
successfullyParsed = true;
hongchan 2017/02/07 18:26:15 This line is not needed.
Raymond Toy 2017/02/14 16:27:57 Done.

Powered by Google App Engine
This is Rietveld 408576698