Index: third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-cancel-and-hold.html |
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-cancel-and-hold.html b/third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-cancel-and-hold.html |
index 9c8b8ed4cc555d2cfcbfbabd0c8b8484a6f66212..f3985202dd48b63f5cf7410b1ed8395058829ae6 100644 |
--- a/third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-cancel-and-hold.html |
+++ b/third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-cancel-and-hold.html |
@@ -1,15 +1,16 @@ |
-<!doctype html> |
+<!DOCTYPE html> |
<html> |
<head> |
+ <title> |
+ Test CancelValuesAndHoldAtTime |
+ </title> |
<script src="../../resources/testharness.js"></script> |
<script src="../../resources/testharnessreport.js"></script> |
<script src="../resources/audit-util.js"></script> |
<script src="../resources/audit.js"></script> |
- <title>Test CancelValuesAndHoldAtTime</title> |
</head> |
- |
<body> |
- <script> |
+ <script id="layout-test-code"> |
let sampleRate = 48000; |
let renderDuration = 0.5; |
@@ -376,7 +377,8 @@ |
return { |
expectedConstant: expectedConstant, |
- autoMessage: message + ': linearRampToValue(' + v1 + ', ' + t1 + ')', |
+ autoMessage: |
+ message + ': linearRampToValue(' + v1 + ', ' + t1 + ')', |
summary: message, |
}; |
} |
@@ -410,8 +412,8 @@ |
// automation is being used, and |errorThreshold| that is the error |
// threshold between the expected curve and the actual curve. |
// |
- function cancelTest(should, testerFunction, thresholdOptions, |
- postCancelTest) { |
+ function cancelTest( |
+ should, testerFunction, thresholdOptions, postCancelTest) { |
// Create a context with three channels. Channel 0 is the test channel |
// containing the actual output that includes the cancellation of |
// events. Channel 1 is the expected data upto the cancellation so we |
@@ -419,8 +421,8 @@ |
// is for verifying events inserted after the cancellation so we can |
// verify that automations are correctly generated after the |
// cancellation point. |
- let context = new OfflineAudioContext(3, renderDuration * sampleRate, |
- sampleRate); |
+ let context = |
+ new OfflineAudioContext(3, renderDuration * sampleRate, sampleRate); |
// Test source is a constant signal |
let src = context.createBufferSource(); |
@@ -456,8 +458,8 @@ |
let constantEndTime; |
if (postCancelTest) { |
- postResult = postCancelTest([g0, g1, g2], cancelTime, |
- expectedConstant); |
+ postResult = |
+ postCancelTest([g0, g1, g2], cancelTime, expectedConstant); |
constantEndTime = postResult.constantEndTime; |
} |
@@ -478,7 +480,7 @@ |
// Go! |
src.start(); |
- return context.startRendering().then(function (buffer) { |
+ return context.startRendering().then(function(buffer) { |
let actual = buffer.getChannelData(0); |
let expected = buffer.getChannelData(1); |
@@ -493,11 +495,12 @@ |
// should be but round-off may make them differ slightly due to the |
// way cancelling is done. |
let endFrame = Math.floor(cancelTime * sampleRate); |
- should(actual.slice(0, endFrame), |
- autoMessage + " up to time " + cancelTime) |
- .beCloseToArray(expected.slice(0, endFrame), { |
- absoluteThreshold: thresholdOptions.curveThreshold |
- }); |
+ should( |
+ actual.slice(0, endFrame), |
+ autoMessage + ' up to time ' + cancelTime) |
+ .beCloseToArray( |
+ expected.slice(0, endFrame), |
+ {absoluteThreshold: thresholdOptions.curveThreshold}); |
// Verify the output after the cancellation is a constant. |
let actualTail; |
@@ -512,26 +515,28 @@ |
let actualConstant = actual[cancelFrame]; |
- should(actualTail, "Cancelling " + autoMessage + " at time " + |
- cancelTime) |
- .beConstantValueOf(actualConstant); |
+ should( |
+ actualTail, |
+ 'Cancelling ' + autoMessage + ' at time ' + cancelTime) |
+ .beConstantValueOf(actualConstant); |
// Verify that the constant is the value we expect. |
- should(actualConstant, "Expected value for cancelling " + |
- autoMessage + " at time " + |
- cancelTime) |
- .beCloseTo(expectedConstant, { |
- threshold: thresholdOptions.valueThreshold |
- }); |
+ should( |
+ actualConstant, |
+ 'Expected value for cancelling ' + autoMessage + ' at time ' + |
+ cancelTime) |
+ .beCloseTo( |
+ expectedConstant, |
+ {threshold: thresholdOptions.valueThreshold}); |
// Verify the curve after the constantEndTime matches our |
// expectations. |
if (postCancelTest) { |
let c2 = buffer.getChannelData(2); |
should(actual.slice(constantEndFrame), postResult.message) |
- .beCloseToArray(c2.slice(constantEndFrame), { |
- absoluteThreshold: postResult.errorThreshold || 0 |
- }); |
+ .beCloseToArray( |
+ c2.slice(constantEndFrame), |
+ {absoluteThreshold: postResult.errorThreshold || 0}); |
} |
}); |
} |