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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/DynamicsCompressor/dynamicscompressor-clear-internal-state.html

Issue 2673743002: Convert DynamicsCompressor tests to testharness (Closed)
Patch Set: Address review comments. 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/DynamicsCompressor/dynamicscompressor-clear-internal-state.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/DynamicsCompressor/dynamicscompressor-clear-internal-state.html b/third_party/WebKit/LayoutTests/webaudio/DynamicsCompressor/dynamicscompressor-clear-internal-state.html
index b90034c4e96766709e4a3dad1c6e668d25801575..65fc81ea0ca7b2ef9ae7e847416c97e6e54c9f48 100644
--- a/third_party/WebKit/LayoutTests/webaudio/DynamicsCompressor/dynamicscompressor-clear-internal-state.html
+++ b/third_party/WebKit/LayoutTests/webaudio/DynamicsCompressor/dynamicscompressor-clear-internal-state.html
@@ -2,45 +2,29 @@
<html>
<head>
<title>Validate Reduction Value of DynamicsComporessor after Disabling</title>
- <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/audit.js"></script>
</head>
<body>
<script>
- description("Validate Reduction Value of DynamicsComporessor after Disabling");
-
- var context;
- var buffer;
- var source;
- var compressor;
- var renderedData;
-
- var sampleRate = 44100;
- var testDurationSamples = 44100;
-
- function checkResult (event) {
-
- renderedData = event.renderedBuffer.getChannelData(0);
-
- // Check that the reduction value is 0.0.
- if (compressor.reduction !== 0.0) {
- testFailed("Expected reduction of 0.0, but the value is " + compressor.reduction);
- }
- else {
- testPassed("Reduction is 0.0");
- }
-
- finishJSTest();
- }
-
- function runTest() {
- window.jsTestIsAsync = true;
-
+ let audit = Audit.createTaskRunner();
+ let context;
+ let buffer;
+ let source;
+ let compressor;
+
+ let sampleRate = 44100;
+ let testDurationSamples = 44100;
+
+ audit.define("test", function (task, should) {
+ task.describe(
+ "Validate Reduction Value of DynamicsCompressor after Disabling"
+ );
// Create the offline context for the test.
context = new OfflineAudioContext(1, testDurationSamples, sampleRate);
- context.oncomplete = checkResult;
// Create the constant sample buffer of 0.5 sec.
buffer = createConstantBuffer(context, testDurationSamples / 2, 1);
@@ -56,11 +40,16 @@
source.start(0.0);
// Render it!
- context.startRendering();
- }
-
- runTest();
- succesfullyParsed = true;
+ context.startRendering()
+ .then(() => {
+ // Check that the reduction value is 0.0.
+ should(compressor.reduction, "compressor.reduction")
+ .beEqualTo(0);
+ task.done();
+ });
+ });
+
+ audit.run();
</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698