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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/MediaStreamAudioDestination/mediastreamaudiodestinationnode.html

Issue 2694173006: Convert MediaStreamAudioDestination tests to testharness (Closed)
Patch Set: Remove task.describe 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/MediaStreamAudioDestination/mediastreamaudiodestinationnode-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a57c0c959759d6b062b933b6c9299a09a9c2373e 100644
--- a/third_party/WebKit/LayoutTests/webaudio/MediaStreamAudioDestination/mediastreamaudiodestinationnode.html
+++ b/third_party/WebKit/LayoutTests/webaudio/MediaStreamAudioDestination/mediastreamaudiodestinationnode.html
@@ -2,59 +2,59 @@
<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,
hongchan 2017/02/24 23:18:04 Is this what clang-format does? I actually prefer
Raymond Toy 2017/02/24 23:24:30 Yes. Maybe adding { } will change the layout?
Raymond Toy 2017/02/24 23:28:42 Nope. We get should( () => {medi
hongchan 2017/02/24 23:34:26 Then at least we should add a space after/before c
Raymond Toy 2017/02/24 23:48:02 I originally started with () => { media = 9
hongchan 2017/02/27 18:00:54 Acknowledged.
+ 'Setting the channel count beyond 8')
+ .throw('NotSupportedError');
+
+ // Check number of inputs and outputs.
+ should(
+ mediaStreamDestination.numberOfInputs,
+ 'mediaStreamDestination.numberOfInputs')
+ .beEqualTo(1);
+
+ // 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).
hongchan 2017/02/24 23:18:04 Do we still need this commented out section?
Raymond Toy 2017/02/24 23:24:30 This addStream part? We should probably test that
hongchan 2017/02/24 23:34:26 I meant between the line 43 ~ 52.
Raymond Toy 2017/02/24 23:48:02 I think we should just make it test that we have o
hongchan 2017/02/27 18:00:54 Acknowledged.
+
+ task.done();
+ });
+
+audit.run();
</script>
</body>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/MediaStreamAudioDestination/mediastreamaudiodestinationnode-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698