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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/constructor/audiobuffersource.html

Issue 2768983002: Fix duplicate test names in WebAudio tests (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Test Constructor: AudioBufferSource</title> 4 <title>Test Constructor: AudioBufferSource</title>
5 <script src="../../resources/testharness.js"></script> 5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script> 6 <script src="../../resources/testharnessreport.js"></script>
7 <script src="../resources/audit-util.js"></script> 7 <script src="../resources/audit-util.js"></script>
8 <script src="../resources/audio-testing.js"></script> 8 <script src="../resources/audio-testing.js"></script>
9 <script src="audionodeoptions.js"></script> 9 <script src="audionodeoptions.js"></script>
10 </head> 10 </head>
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 var node; 49 var node;
50 var success = true; 50 var success = true;
51 51
52 success = Should("node = new AudioBufferSourceNode(c)", function () { 52 success = Should("node = new AudioBufferSourceNode(c)", function () {
53 node = new AudioBufferSourceNode(context); 53 node = new AudioBufferSourceNode(context);
54 }).notThrow() && success; 54 }).notThrow() && success;
55 55
56 success = Should("node instanceof AudioBufferSourceNode", 56 success = Should("node instanceof AudioBufferSourceNode",
57 node instanceof AudioBufferSourceNode).beEqualTo(true) && success; 57 node instanceof AudioBufferSourceNode).beEqualTo(true) && success;
58 58
59 success = Should("node.buffer === null", node.buffer === null) 59 success = Should("node0.buffer === null", node.buffer === null)
60 .beEqualTo(true) && success; 60 .beEqualTo(true) && success;
61 61
62 // This node using the factory method is used as a reference for the 62 // This node using the factory method is used as a reference for the
63 // defautl values. 63 // defautl values.
64 var factoryNode = context.createBufferSource(); 64 var factoryNode = context.createBufferSource();
65 65
66 var testAttributes = ["buffer", "detune", "loop", "loopEnd", "loopStart" , 66 var testAttributes = ["buffer", "detune", "loop", "loopEnd", "loopStart" ,
67 "playbackRate"]; 67 "playbackRate"];
68 68
69 for (var index in testAttributes) { 69 for (var index in testAttributes) {
70 var name = testAttributes[index]; 70 var name = testAttributes[index];
71 71
72 if (node[name] instanceof AudioParam) { 72 if (node[name] instanceof AudioParam) {
73 success = Should("node." + name + ".value", node[name].value) 73 success = Should("node0." + name + ".value", node[name].value)
74 .beEqualTo(factoryNode[name].value) && success; 74 .beEqualTo(factoryNode[name].value) && success;
75 } else { 75 } else {
76 success = Should("node." + name, node[name]) 76 success = Should("node0." + name, node[name])
77 .beEqualTo(factoryNode[name]) && success; 77 .beEqualTo(factoryNode[name]) && success;
78 } 78 }
79 } 79 }
80 80
81 Should("AudioBufferSourceNode constructed", success) 81 Should("AudioBufferSourceNode constructed", success)
82 .summarize("correctly", "incorrectly"); 82 .summarize("correctly", "incorrectly");
83 83
84 taskDone(); 84 taskDone();
85 }); 85 });
86 86
87 audit.defineTask("nullable buffer", function (taskDone) { 87 audit.defineTask("nullable buffer", function (taskDone) {
88 var node; 88 var node;
89 var success = true; 89 var success = true;
90 90
91 var options = { buffer: null }; 91 var options = { buffer: null };
92 92
93 success = Should("node = new AudioBufferSourceNode(c, " + JSON.stringify (options), function () { 93 success = Should("node1 = new AudioBufferSourceNode(c, " + JSON.stringif y(options), function () {
94 node = new AudioBufferSourceNode(context, options); 94 node = new AudioBufferSourceNode(context, options);
95 }).notThrow(); 95 }).notThrow();
96 96
97 success = Should("node.buffer", node.buffer) 97 success = Should("node1.buffer", node.buffer)
98 .beEqualTo(null); 98 .beEqualTo(null);
99 99
100 Should("Null buffer in constructor handled", success) 100 Should("Null buffer in constructor handled", success)
101 .summarize( 101 .summarize(
102 "correctly", 102 "correctly",
103 "incorrectly"); 103 "incorrectly");
104 104
105 taskDone(); 105 taskDone();
106 }); 106 });
107 107
(...skipping 21 matching lines...) Expand all
129 // Use the factory method to create an equivalent node and compare the 129 // Use the factory method to create an equivalent node and compare the
130 // results from the constructor against this node. 130 // results from the constructor against this node.
131 var factoryNode = context.createBufferSource(); 131 var factoryNode = context.createBufferSource();
132 factoryNode.buffer = options.buffer; 132 factoryNode.buffer = options.buffer;
133 factoryNode.detune.value = options.detune; 133 factoryNode.detune.value = options.detune;
134 factoryNode.loop = options.loop; 134 factoryNode.loop = options.loop;
135 factoryNode.loopEnd = options.loopEnd; 135 factoryNode.loopEnd = options.loopEnd;
136 factoryNode.loopStart = options.loopStart; 136 factoryNode.loopStart = options.loopStart;
137 factoryNode.playbackRate.value = options.playbackRate; 137 factoryNode.playbackRate.value = options.playbackRate;
138 138
139 success = Should("node.buffer === buffer", node.buffer === buffer) 139 success = Should("node2.buffer === buffer", node.buffer === buffer)
140 .beEqualTo(true) && success; 140 .beEqualTo(true) && success;
141 success = Should("node.detune.value", node.detune.value) 141 success = Should("node2.detune.value", node.detune.value)
142 .beEqualTo(factoryNode.detune.value) && success; 142 .beEqualTo(factoryNode.detune.value) && success;
143 success = Should("node.loop", node.loop) 143 success = Should("node2.loop", node.loop)
144 .beEqualTo(factoryNode.loop) && success; 144 .beEqualTo(factoryNode.loop) && success;
145 success = Should("node.loopEnd", node.loopEnd) 145 success = Should("node2.loopEnd", node.loopEnd)
146 .beEqualTo(factoryNode.loopEnd) && success; 146 .beEqualTo(factoryNode.loopEnd) && success;
147 success = Should("node.loopStart", node.loopStart) 147 success = Should("node2.loopStart", node.loopStart)
148 .beEqualTo(factoryNode.loopStart) && success; 148 .beEqualTo(factoryNode.loopStart) && success;
149 success = Should("node.playbackRate.value", node.playbackRate.value) 149 success = Should("node2.playbackRate.value", node.playbackRate.value)
150 .beEqualTo(factoryNode.playbackRate.value) && success; 150 .beEqualTo(factoryNode.playbackRate.value) && success;
151 151
152 Should("AudioBufferSource with options cosntructed", success) 152 Should("AudioBufferSource with options cosntructed", success)
153 .summarize("correctly", "incorrectly"); 153 .summarize("correctly", "incorrectly");
154 154
155 taskDone(); 155 taskDone();
156 }); 156 });
157 157
158 audit.runTasks(); 158 audit.runTasks();
159 </script> 159 </script>
160 </body> 160 </body>
161 </html> 161 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698