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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/constructor/oscillator.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: Oscillator</title> 4 <title>Test Constructor: Oscillator</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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 "correctly threw errors", 42 "correctly threw errors",
43 "did not throw errors in all cases"); 43 "did not throw errors in all cases");
44 44
45 taskDone(); 45 taskDone();
46 }); 46 });
47 47
48 audit.defineTask("default constructor", function (taskDone) { 48 audit.defineTask("default constructor", function (taskDone) {
49 var node; 49 var node;
50 var success = true; 50 var success = true;
51 51
52 success = Should("node = new OscillatorNode(context)", function () { 52 success = Should("node0 = new OscillatorNode(context)", function () {
53 node = new OscillatorNode(context); 53 node = new OscillatorNode(context);
54 }).notThrow(); 54 }).notThrow();
55 success = Should("node instanceof OscillatorNode", node instanceof Oscil latorNode) 55 success = Should("node0 instanceof OscillatorNode", node instanceof Osci llatorNode)
56 .beEqualTo(true) && success; 56 .beEqualTo(true) && success;
57 57
58 success = Should("node.type", node.type) 58 success = Should("node0.type", node.type)
59 .beEqualTo("sine") && success; 59 .beEqualTo("sine") && success;
60 success = Should("node.detune.value", node.detune.value) 60 success = Should("node0.detune.value", node.detune.value)
61 .beEqualTo(0) && success; 61 .beEqualTo(0) && success;
62 success = Should("node.frequency.value", node.frequency.value) 62 success = Should("node0.frequency.value", node.frequency.value)
63 .beEqualTo(440) && success; 63 .beEqualTo(440) && success;
64 64
65 success = Should("node.channelCount", node.channelCount) 65 success = Should("node0.channelCount", node.channelCount)
66 .beEqualTo(2) && success; 66 .beEqualTo(2) && success;
67 success = Should("node.channelCountMode", node.channelCountMode) 67 success = Should("node0.channelCountMode", node.channelCountMode)
68 .beEqualTo("max") && success; 68 .beEqualTo("max") && success;
69 success = Should("node.channelInterpretation", node.channelInterpretatio n) 69 success = Should("node0.channelInterpretation", node.channelInterpretati on)
70 .beEqualTo("speakers") && success; 70 .beEqualTo("speakers") && success;
71 71
72 Should("new OscillatorNode(context)", success) 72 Should("new OscillatorNode(context)", success)
73 .summarize( 73 .summarize(
74 "constructed node with correct attributes", 74 "constructed node with correct attributes",
75 "did not construct correct node correctly") 75 "did not construct correct node correctly")
76 76
77 taskDone(); 77 taskDone();
78 }); 78 });
79 79
80 audit.defineTask("test AudioNodeOptions", function (taskDone) { 80 audit.defineTask("test AudioNodeOptions", function (taskDone) {
81 testAudioNodeOptions(context, "OscillatorNode"); 81 testAudioNodeOptions(context, "OscillatorNode");
82 taskDone(); 82 taskDone();
83 }); 83 });
84 84
85 audit.defineTask("constructor options", function (taskDone) { 85 audit.defineTask("constructor options", function (taskDone) {
86 var node; 86 var node;
87 var success = true; 87 var success = true;
88 var options = { 88 var options = {
89 type: "sawtooth", 89 type: "sawtooth",
90 detune: 7, 90 detune: 7,
91 frequency: 918 91 frequency: 918
92 }; 92 };
93 93
94 success = Should("node = new OscillatorNode(c, " + JSON.stringify(option s) + ")", 94 success = Should("node1 = new OscillatorNode(c, " + JSON.stringify(optio ns) + ")",
95 function () { 95 function () {
96 node = new OscillatorNode(context, options); 96 node = new OscillatorNode(context, options);
97 }).notThrow(); 97 }).notThrow();
98 98
99 success = Should("node.type", node.type) 99 success = Should("node1.type", node.type)
100 .beEqualTo(options.type) && success; 100 .beEqualTo(options.type) && success;
101 success = Should("node.detune.value", node.detune.value) 101 success = Should("node1.detune.value", node.detune.value)
102 .beEqualTo(options.detune) && success; 102 .beEqualTo(options.detune) && success;
103 success = Should("node.frequency.value", node.frequency.value) 103 success = Should("node1.frequency.value", node.frequency.value)
104 .beEqualTo(options.frequency) && success; 104 .beEqualTo(options.frequency) && success;
105 105
106 success = Should("node.channelCount", node.channelCount) 106 success = Should("node1.channelCount", node.channelCount)
107 .beEqualTo(2) && success; 107 .beEqualTo(2) && success;
108 success = Should("node.channelCountMode", node.channelCountMode) 108 success = Should("node1.channelCountMode", node.channelCountMode)
109 .beEqualTo("max") && success; 109 .beEqualTo("max") && success;
110 success = Should("node.channelInterpretation", node.channelInterpretatio n) 110 success = Should("node1.channelInterpretation", node.channelInterpretati on)
111 .beEqualTo("speakers") && success; 111 .beEqualTo("speakers") && success;
112 112
113 // Test that type and periodicWave options work as described. 113 // Test that type and periodicWave options work as described.
114 options = { 114 options = {
115 type: "sine", 115 type: "sine",
116 periodicWave: new PeriodicWave(context, { 116 periodicWave: new PeriodicWave(context, {
117 real: [1, 1] 117 real: [1, 1]
118 }) 118 })
119 }; 119 };
120 success = Should("new OscillatorNode(c, " + JSON.stringify(options) + ") ", 120 success = Should("new OscillatorNode(c, " + JSON.stringify(options) + ") ",
(...skipping 28 matching lines...) Expand all
149 "constructed with correct attributes", 149 "constructed with correct attributes",
150 "was not constructed correctly"); 150 "was not constructed correctly");
151 151
152 taskDone(); 152 taskDone();
153 }); 153 });
154 154
155 audit.runTasks(); 155 audit.runTasks();
156 </script> 156 </script>
157 </body> 157 </body>
158 </html> 158 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698