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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/constructor/mediastreamaudiosource.html

Issue 2842573003: Convert mediastreamaudiosource to new Audit (Closed)
Patch Set: Remove incorrect test. Created 3 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/webaudio/constructor/mediastreamaudiosource.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/constructor/mediastreamaudiosource.html b/third_party/WebKit/LayoutTests/webaudio/constructor/mediastreamaudiosource.html
index 81247f7f7c062475fe3ba51f3d14b502a22c64a6..97fa3aa37ea2265cb5abd808c673349778677667 100644
--- a/third_party/WebKit/LayoutTests/webaudio/constructor/mediastreamaudiosource.html
+++ b/third_party/WebKit/LayoutTests/webaudio/constructor/mediastreamaudiosource.html
@@ -5,63 +5,45 @@
<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>
+ <script src="new-audionodeoptions.js"></script>
</head>
<body>
<script>
- var context = new AudioContext();
+ let context = new AudioContext();
- var audit = Audit.createTaskRunner();
+ let audit = Audit.createTaskRunner();
- audit.defineTask("invalid constructor", function (taskDone) {
- var node;
- var success = true;
-
- success = Should("new MediaStreamAudioSourceNode()", function () {
- node = new MediaStreamAudioSourceNode();
- }).throw("TypeError");
- success = Should("new MediaStreamAudioSourceNode(1)", function () {
- node = new MediaStreamAudioSourceNode(1) && success;
- }).throw("TypeError");
- success = Should("new MediaStreamAudioSourceNode(context, 42)",
- function () {
- node = new MediaStreamAudioSourceNode(context, 42) && success;
- }).throw("TypeError");
-
- Should("Invalid constructors", success)
- .summarize(
- "correctly threw errors",
- "did not throw errors in all cases");
+ audit.define('initialize', (task, should) => {
+ context = initializeContext(should);
+ task.done();
+ });
- taskDone();
+ audit.define('invalid constructor', (task, should) => {
+ testInvalidConstructor(should, 'MediaStreamAudioSourceNode', context);
+ task.done();
});
- audit.defineTask("constructor options", function (taskDone) {
- var node;
- var success = true;
+ audit.define('constructor options', (task, should) => {
+ let node;
- var options = {
- mediaStream: new MediaStream()
- };
+ let options = {mediaStream: new MediaStream()};
// We throw because the mediaStream has no tracks. But otherwise the
// constructor worked.
- success = Should("node = new MediaStreamAudioSourceNode(, " + JSON.stringify(
- options) + ")",
- function () {
- node = new MediaStreamAudioSourceNode(context, options);
- }).throw("InvalidStateError") && success;
-
- Should("new MediaStreamAudioSourceNode(c, options)", success)
- .summarize(
- "constructed with correct attributes",
- "was not constructed correctly");
-
- taskDone();
+ should(
+ () => {
+ node = new MediaStreamAudioSourceNode(context, options);
+ },
+ 'node = new MediaStreamAudioSourceNode(context, ' +
+ JSON.stringify(options) + ')')
+ .throw('InvalidStateError');
+
+ task.done();
});
- audit.runTasks();
+ audit.run();
</script>
</body>
</html>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698