Index: third_party/WebKit/LayoutTests/webaudio/MediaStreamAudioDestination/mediastreamaudiodestinationnode.html |
diff --git a/third_party/WebKit/LayoutTests/webaudio/MediaStreamAudioDestination/mediastreamaudiodestinationnode.html b/third_party/WebKit/LayoutTests/webaudio/MediaStreamAudioDestination/mediastreamaudiodestinationnode.html |
index d3264cebc1c8be577d3d59f5833760c5310ef543..4de2ad85bde7b366ec9d3f1def9c4e8d6cb7ec82 100644 |
--- a/third_party/WebKit/LayoutTests/webaudio/MediaStreamAudioDestination/mediastreamaudiodestinationnode.html |
+++ b/third_party/WebKit/LayoutTests/webaudio/MediaStreamAudioDestination/mediastreamaudiodestinationnode.html |
@@ -2,59 +2,57 @@ |
<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/audit.js"></script> |
</head> |
<body> |
-<div id="description"></div> |
-<div id="console"></div> |
- |
<script> |
-description("Basic tests for MediaStreamAudioDestinationNode API."); |
- |
-var context; |
-var mediaStreamDestination; |
- |
-function runTest() { |
- if (window.testRunner) { |
- testRunner.dumpAsText(); |
- } |
- |
- context = new AudioContext(); |
- |
- mediaStreamDestination = context.createMediaStreamDestination(); |
- |
- // MediaStreamAudioDestinationNode should inherit AudioNode. |
- shouldBe('mediaStreamDestination.__proto__.__proto__', 'AudioNode.prototype'); |
- |
- // Check the channel count boundary of 8. |
- Should('Setting the channel count beyond 8', function () { |
- mediaStreamDestination.channelCount = 9; |
- }).throw('NotSupportedError'); |
- |
- // Check number of inputs and outputs. |
- if (mediaStreamDestination.numberOfInputs == 1) |
- testPassed("Destination AudioNode has one input."); |
- else |
- testFailed("Destination AudioNode should have one input."); |
- |
- // FIXME: We should have no outputs, but since we're implemented using AudioBasicInspectorNode |
- // we have one. |
- // if (mediaStreamDestination.numberOfOutputs == 0) |
- // testPassed("Destination AudioNode has no outputs."); |
- // else |
- // testFailed("Destination AudioNode should not have outputs."); |
- |
- // FIXME: add a test where we create a PeerConnection and call addStream(mediaStreamDestination.stream). |
- |
- finishJSTest(); |
-} |
- |
-runTest(); |
-window.successfullyParsed = true; |
- |
+let audit = Audit.createTaskRunner(); |
+ |
+audit.define( |
+ { |
+ label: 'test', |
+ description: 'Basic tests for MediaStreamAudioDestinationNode API' |
+ }, |
+ (task, should) => { |
+ let context = new AudioContext(); |
+ |
+ let mediaStreamDestination = context.createMediaStreamDestination(); |
+ |
+ // MediaStreamAudioDestinationNode should inherit AudioNode. |
+ should( |
+ mediaStreamDestination instanceof AudioNode, |
+ 'mediaStreamDestination instance') |
+ .beTrue(); |
+ |
+ // Check the channel count boundary of 8. |
+ should( |
+ () => mediaStreamDestination.channelCount = 9, |
+ 'Setting the channel count beyond 8') |
+ .throw('NotSupportedError'); |
+ |
+ // Check number of inputs and outputs. |
+ should( |
+ mediaStreamDestination.numberOfInputs, |
+ 'mediaStreamDestination.numberOfInputs') |
+ .beEqualTo(1); |
+ |
+ // We should have no outputs, but since we're implemented using |
+ // AudioBasicInspectorNode, we have one. |
+ should(mediaStreamDestination.numberOfOutputs, |
+ 'Number of outputs') |
+ .beEqualTo(1); |
+ |
+ // FIXME: add a test where we create a PeerConnection and call |
+ // addStream(mediaStreamDestination.stream). |
+ |
+ task.done(); |
+ }); |
+ |
+audit.run(); |
</script> |
</body> |