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

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

Issue 2828393002: Convert constructor/constantsource.html to use new Audit (Closed)
Patch Set: Rebase 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/constantsource.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/constructor/constantsource.html b/third_party/WebKit/LayoutTests/webaudio/constructor/constantsource.html
index 0a698aee6a637e8befd7664b89bc033237fc5f70..b8a7621253568fe65f3168ebb24324eec8832fef 100644
--- a/third_party/WebKit/LayoutTests/webaudio/constructor/constantsource.html
+++ b/third_party/WebKit/LayoutTests/webaudio/constructor/constantsource.html
@@ -5,7 +5,8 @@
<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>
@@ -14,62 +15,35 @@
var audit = Audit.createTaskRunner();
- audit.defineTask("initialize", function (taskDone) {
- Should("context = new OfflineAudioContext(...)", function () {
- context = new OfflineAudioContext(1, 1, 48000);
- }).notThrow();
- taskDone();
+ audit.define('initialize', (task, should) => {
+ context = initializeContext(should);
+ task.done();
});
- audit.defineTask("invalid constructor", function (taskDone) {
- var node;
- var success = true;
-
- succes = Should("new ConstantSourceNode()", function () {
- node = new ConstantSourceNode();
- }).throw("TypeError");
- success = Should("new ConstantSourceNode(1)", function () {
- node = new ConstantSourceNode(1);
- }).throw("TypeError") && success;
- success = Should("new ConstantSourceNode(context, 42)", function () {
- node = new ConstantSourceNode(context, 42);
- }).throw("TypeError") && success;
-
- Should("*** Invalid constructors", success)
- .summarize(
- "correctly threw errors",
- "did not throw errors in all cases");
- taskDone();
+ audit.define('invalid constructor', (task, should) => {
+ testInvalidConstructor(should, 'ConstantSourceNode', context);
+ task.done();
});
- audit.defineTask("default constructor", function (taskDone) {
- var node;
- var success = true;
-
- success = Should("node = new ConstantSourceNode(context)", function () {
- node = new ConstantSourceNode(context);
- }).notThrow();
- success = Should("node instanceOf ConstantSourceNode", node instanceof ConstantSourceNode)
- .beEqualTo(true) && success;
- success = Should("node.offset.value", node.offset.value)
- .beEqualTo(1) && success;
-
- success = Should("node.channelCount", node.channelCount)
- .beEqualTo(2) && success;
- success = Should("node.channelCountMode", node.channelCountMode)
- .beEqualTo("max") && success;
- success = Should("node.channelInterpretation", node.channelInterpretation)
- .beEqualTo("speakers") && success;
-
- success = Should("*** new AnalyserNode(context)", success)
- .summarize(
- "constructed node with correct attributes",
- "did not construct correct node correctly")
-
- taskDone();
+ audit.define('default constructor', (task, should) => {
+ let prefix = 'node0';
+ let node =
+ testDefaultConstructor(should, 'ConstantSourceNode', context, {
+ prefix: prefix,
+ numberOfInputs: 0,
+ numberOfOutputs: 1,
+ channelCount: 2,
+ channelCountMode: 'max',
+ channelInterpretation: 'speakers'
+ });
+
+ testDefaultAttributes(
+ should, node, prefix, [{name: 'offset', value: 1}]);
+
+ 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