OLD | NEW |
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/CrossThreadFunctional.h" | 9 #include "platform/CrossThreadFunctional.h" |
10 #include "platform/WebTaskRunner.h" | 10 #include "platform/WebTaskRunner.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 const PushPullFIFOStateForTest actual_state = fifo->GetStateForTest(); | 168 const PushPullFIFOStateForTest actual_state = fifo->GetStateForTest(); |
169 | 169 |
170 // Verify the read/write indexes. | 170 // Verify the read/write indexes. |
171 EXPECT_EQ(expected_state.index_read, actual_state.index_read); | 171 EXPECT_EQ(expected_state.index_read, actual_state.index_read); |
172 EXPECT_EQ(expected_state.index_write, actual_state.index_write); | 172 EXPECT_EQ(expected_state.index_write, actual_state.index_write); |
173 EXPECT_EQ(expected_state.overflow_count, actual_state.overflow_count); | 173 EXPECT_EQ(expected_state.overflow_count, actual_state.overflow_count); |
174 EXPECT_EQ(expected_state.underflow_count, actual_state.underflow_count); | 174 EXPECT_EQ(expected_state.underflow_count, actual_state.underflow_count); |
175 | 175 |
176 // Verify in-FIFO samples. | 176 // Verify in-FIFO samples. |
177 for (const auto& sample : expected_state.fifo_samples) { | 177 for (const auto& sample : expected_state.fifo_samples) { |
178 EXPECT_TRUE(VerifyBusValueAtIndex(fifo->GetFIFOBusForTest(), | 178 EXPECT_TRUE(VerifyBusValueAtIndex(fifo->GetFIFOBusForTest(), sample.index, |
179 sample.index, sample.value)); | 179 sample.value)); |
180 } | 180 } |
181 | 181 |
182 // Verify samples from the most recent output bus. | 182 // Verify samples from the most recent output bus. |
183 for (const auto& sample : expected_state.output_samples) { | 183 for (const auto& sample : expected_state.output_samples) { |
184 EXPECT_TRUE( | 184 EXPECT_TRUE( |
185 VerifyBusValueAtIndex(output_bus.Get(), sample.index, sample.value)); | 185 VerifyBusValueAtIndex(output_bus.Get(), sample.index, sample.value)); |
186 } | 186 } |
187 } | 187 } |
188 | 188 |
189 FIFOTestParam g_feature_test_params[] = { | 189 FIFOTestParam g_feature_test_params[] = { |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 // - Output bus samples (index, expectedValue) = (0, 0), (143, 0) | 361 // - Output bus samples (index, expectedValue) = (0, 0), (143, 0) |
362 {0, 0, 0, 4, {{0, 0}, {1023, 0}}, {{0, 0}, {143, 0}}}}}; | 362 {0, 0, 0, 4, {{0, 0}, {1023, 0}}, {{0, 0}, {143, 0}}}}}; |
363 | 363 |
364 INSTANTIATE_TEST_CASE_P(PushPullFIFOFeatureTest, | 364 INSTANTIATE_TEST_CASE_P(PushPullFIFOFeatureTest, |
365 PushPullFIFOFeatureTest, | 365 PushPullFIFOFeatureTest, |
366 ::testing::ValuesIn(g_feature_test_params)); | 366 ::testing::ValuesIn(g_feature_test_params)); |
367 | 367 |
368 } // namespace | 368 } // namespace |
369 | 369 |
370 } // namespace blink | 370 } // namespace blink |
OLD | NEW |