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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/ChannelSplitter/audiochannelsplitter.html

Issue 2708953003: Move task.describe descriptions to audit.define (Closed)
Patch Set: Address review comments. Created 3 years, 10 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 2
3 <!-- 3 <!--
4 Tests that AudioChannelSplitter works correctly. 4 Tests that AudioChannelSplitter works correctly.
5 --> 5 -->
6 6
7 <html> 7 <html>
8 <head> 8 <head>
9 <script src="../../resources/testharness.js"></script> 9 <script src="../../resources/testharness.js"></script>
10 <script src="../../resources/testharnessreport.js"></script> 10 <script src="../../resources/testharnessreport.js"></script>
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 success = should(bufferDataR, "Right channel") 55 success = should(bufferDataR, "Right channel")
56 .beConstantValueOf(1) && success; 56 .beConstantValueOf(1) && success;
57 } else { 57 } else {
58 success = false; 58 success = false;
59 } 59 }
60 60
61 should(success, "Left and right channels were exchanged") 61 should(success, "Left and right channels were exchanged")
62 .message("correctly", "incorrectly"); 62 .message("correctly", "incorrectly");
63 } 63 }
64 64
65 audit.define("construction", function (task, should) { 65 audit.define({
66 task.describe("Construction of ChannelSplitterNode"); 66 label: "construction",
67 description: "Construction of ChannelSplitterNode"
68 }, function (task, should) {
67 69
68 // Create stereo offline audio context. 70 // Create stereo offline audio context.
69 context = new OfflineAudioContext(2, lengthInSampleFrames, sampleRate); 71 context = new OfflineAudioContext(2, lengthInSampleFrames, sampleRate);
70 72
71 var splitternode; 73 var splitternode;
72 should(() => { 74 should(() => {
73 var splitternode = context.createChannelSplitter(0); 75 var splitternode = context.createChannelSplitter(0);
74 }, "createChannelSplitter(0)") 76 }, "createChannelSplitter(0)")
75 .throw("IndexSizeError"); 77 .throw("IndexSizeError");
76 78
(...skipping 19 matching lines...) Expand all
96 }, "splitternode = context.createChannelSplitter()") 98 }, "splitternode = context.createChannelSplitter()")
97 .notThrow(); 99 .notThrow();
98 100
99 should(splitternode.numberOfOutputs, 101 should(splitternode.numberOfOutputs,
100 "splitternode.numberOfOutputs") 102 "splitternode.numberOfOutputs")
101 .beEqualTo(6); 103 .beEqualTo(6);
102 104
103 task.done(); 105 task.done();
104 }); 106 });
105 107
106 audit.define("functionality", function (task, should) { 108 audit.define({
107 task.describe("Functionality of ChannelSplitterNode"); 109 label: "functionality",
110 description: "Functionality of ChannelSplitterNode"
111 }, function (task, should) {
108 112
109 // Create a stereo buffer, with all +1 values in left channel, all -1 in rig ht channel. 113 // Create a stereo buffer, with all +1 values in left channel, all -1 in rig ht channel.
110 sourceBuffer = createStereoBufferWithDCOffset(lengthInSampleFrames, sampleRa te, 1); 114 sourceBuffer = createStereoBufferWithDCOffset(lengthInSampleFrames, sampleRa te, 1);
111 115
112 sourceNode = context.createBufferSource(); 116 sourceNode = context.createBufferSource();
113 sourceNode.buffer = sourceBuffer; 117 sourceNode.buffer = sourceBuffer;
114 118
115 // Create a channel splitter and connect it so that it split the stereo stre am into two mono streams. 119 // Create a channel splitter and connect it so that it split the stereo stre am into two mono streams.
116 channelSplitter = context.createChannelSplitter(2); 120 channelSplitter = context.createChannelSplitter(2);
117 sourceNode.connect(channelSplitter); 121 sourceNode.connect(channelSplitter);
(...skipping 12 matching lines...) Expand all
130 .then(buffer => checkResult(buffer, should)) 134 .then(buffer => checkResult(buffer, should))
131 .then(task.done.bind(task)); 135 .then(task.done.bind(task));
132 }); 136 });
133 137
134 audit.run(); 138 audit.run();
135 139
136 </script> 140 </script>
137 141
138 </body> 142 </body>
139 </html> 143 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698