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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/MediaElementAudioSource/mediaelementaudiosourcenode.html

Issue 2695283003: Convert MediaElementAudioSource tests to testharness. (Closed)
Patch Set: Revert changes to *-{gc,wrapper}.html Created 3 years, 9 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/MediaElementAudioSource/mediaelementaudiosourcenode-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/MediaElementAudioSource/mediaelementaudiosourcenode.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/MediaElementAudioSource/mediaelementaudiosourcenode.html b/third_party/WebKit/LayoutTests/webaudio/MediaElementAudioSource/mediaelementaudiosourcenode.html
index 1628bc65ddb514b2591cb59d02ac9cd267f0a383..86b933b6326750e346d598eeb6e8d7b550db93b1 100644
--- a/third_party/WebKit/LayoutTests/webaudio/MediaElementAudioSource/mediaelementaudiosourcenode.html
+++ b/third_party/WebKit/LayoutTests/webaudio/MediaElementAudioSource/mediaelementaudiosourcenode.html
@@ -2,51 +2,64 @@
<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 MediaElementAudioSourceNode API.");
+let audit = Audit.createTaskRunner();
-var context = 0;
-var audioElement = 0;
-var audioNode = 0;
+audit.define(
+ {
+ label: 'test',
+ description: 'Basic tests for MediaElementAudioSourceNode API'
+ },
+ (task, should) => {
-function runTest() {
- window.jsTestIsAsync = true;
+ let context = new AudioContext();
- context = new AudioContext();
+ let audioElement = new Audio();
+ let mediaSource = context.createMediaElementSource(audioElement);
+ let audioNode = mediaSource;
- audioElement = new Audio();
- mediaSource = context.createMediaElementSource(audioElement);
- audioNode = mediaSource;
+ // Check number of inputs and outputs.
+ should(audioNode.numberOfInputs, 'audioNode.numberOfInputs').beEqualTo(0);
+ should(audioNode.numberOfOutputs, 'audioNode.numberOfOutputs')
+ .beEqualTo(1);
- // Check number of inputs and outputs.
- shouldBeEqualToNumber("audioNode.numberOfInputs", 0);
- shouldBeEqualToNumber("audioNode.numberOfOutputs", 1);
+ // Try calling connect() method with illegal values: illegal destination,
+ // illegal output index, and illegal input index.
+ should(() => audioNode.connect(0, 0, 0), 'audioNode.connect(0, 0, 0)')
+ .throw('TypeError');
+ should(
+ () => audioNode.connect(context.destination, 5, 0),
+ 'audioNode.connect(context.destination, 5, 0)')
+ .throw('IndexSizeError');
+ should(
+ () => audioNode.connect(context.destination, 0, 5),
+ 'audioNode.connect(context.destination, 0, 5)')
+ .throw('IndexSizeError');
- // Try calling connect() method with illegal values: illegal destination, illegal output index,
- // and illegal input index.
- shouldThrow("audioNode.connect(0, 0, 0)");
- shouldThrow("audioNode.connect(context.destination, 5, 0)");
- shouldThrow("audioNode.connect(context.destination, 0, 5)");
+ // Try calling connect() with proper values.
+ should(
+ () => audioNode.connect(context.destination, 0, 0),
+ 'audioNode.connect(context.destination, 0, 0)')
+ .notThrow();
- // Try calling connect() with proper values.
- shouldNotThrow("audioNode.connect(context.destination, 0, 0)");
-
- // Try creating another MediaElementAudioSourceNode using the same audio element.
- shouldThrow("context.createMediaElementSource(audioElement)");
+ // Try creating another MediaElementAudioSourceNode using the same audio
+ // element.
+ should(
+ () => context.createMediaElementSource(audioElement),
+ 'context.createMediaElementSource(audioElement)')
+ .throw();
- finishJSTest();
-}
+ task.done();
+ });
-runTest();
+audit.run();
</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/MediaElementAudioSource/mediaelementaudiosourcenode-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698