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

Side by Side Diff: third_party/WebKit/Source/platform/audio/PushPullFIFOTest.cpp

Issue 2777903005: Add WebThread in AudioDestination to support AudioWorkletThread (Closed)
Patch Set: Addressing feedback 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/audio/PushPullFIFO.h" 5 #include "platform/audio/PushPullFIFO.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 #include "platform/audio/AudioUtilities.h" 9 #include "platform/audio/AudioUtilities.h"
10 #include "platform/testing/TestingPlatformSupport.h" 10 #include "platform/testing/TestingPlatformSupport.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 const PushPullFIFOStateForTest actualState = fifo->getStateForTest(); 162 const PushPullFIFOStateForTest actualState = fifo->getStateForTest();
163 163
164 // Verify the read/write indexes. 164 // Verify the read/write indexes.
165 EXPECT_EQ(expectedState.indexRead, actualState.indexRead); 165 EXPECT_EQ(expectedState.indexRead, actualState.indexRead);
166 EXPECT_EQ(expectedState.indexWrite, actualState.indexWrite); 166 EXPECT_EQ(expectedState.indexWrite, actualState.indexWrite);
167 EXPECT_EQ(expectedState.overflowCount, actualState.overflowCount); 167 EXPECT_EQ(expectedState.overflowCount, actualState.overflowCount);
168 EXPECT_EQ(expectedState.underflowCount, actualState.underflowCount); 168 EXPECT_EQ(expectedState.underflowCount, actualState.underflowCount);
169 169
170 // Verify in-FIFO samples. 170 // Verify in-FIFO samples.
171 for (const auto& sample : expectedState.fifoSamples) { 171 for (const auto& sample : expectedState.fifoSamples) {
172 EXPECT_TRUE(verifyBusValueAtIndex(fifo->bus(), sample.index, sample.value)); 172 EXPECT_TRUE(verifyBusValueAtIndex(fifo->getFIFOBusForTest(), sample.index,
173 sample.value));
173 } 174 }
174 175
175 // Verify samples from the most recent output bus. 176 // Verify samples from the most recent output bus.
176 for (const auto& sample : expectedState.outputSamples) { 177 for (const auto& sample : expectedState.outputSamples) {
177 EXPECT_TRUE( 178 EXPECT_TRUE(
178 verifyBusValueAtIndex(outputBus.get(), sample.index, sample.value)); 179 verifyBusValueAtIndex(outputBus.get(), sample.index, sample.value));
179 } 180 }
180 } 181 }
181 182
182 FIFOTestParam featureTestParams[] = { 183 FIFOTestParam featureTestParams[] = {
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 // - Output bus samples (index, expectedValue) = (0, 0), (143, 0) 355 // - Output bus samples (index, expectedValue) = (0, 0), (143, 0)
355 {0, 0, 0, 4, {{0, 0}, {1023, 0}}, {{0, 0}, {143, 0}}}}}; 356 {0, 0, 0, 4, {{0, 0}, {1023, 0}}, {{0, 0}, {143, 0}}}}};
356 357
357 INSTANTIATE_TEST_CASE_P(PushPullFIFOFeatureTest, 358 INSTANTIATE_TEST_CASE_P(PushPullFIFOFeatureTest,
358 PushPullFIFOFeatureTest, 359 PushPullFIFOFeatureTest,
359 ::testing::ValuesIn(featureTestParams)); 360 ::testing::ValuesIn(featureTestParams));
360 361
361 } // namespace 362 } // namespace
362 363
363 } // namespace blink 364 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698