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

Unified Diff: third_party/WebKit/Source/platform/audio/PushPullFIFOTest.cpp

Issue 2777903005: Add WebThread in AudioDestination to support AudioWorkletThread (Closed)
Patch Set: Added Unit Test for multi-thread support 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/audio/PushPullFIFOTest.cpp
diff --git a/third_party/WebKit/Source/platform/audio/PushPullFIFOTest.cpp b/third_party/WebKit/Source/platform/audio/PushPullFIFOTest.cpp
index 9351b4281d13b47fbf34e13dc8b9ae9643a9dabb..f2dcc14ccab905db80ba1e84664c50d8a86269ea 100644
--- a/third_party/WebKit/Source/platform/audio/PushPullFIFOTest.cpp
+++ b/third_party/WebKit/Source/platform/audio/PushPullFIFOTest.cpp
@@ -6,9 +6,14 @@
#include <memory>
#include <vector>
+#include "platform/CrossThreadFunctional.h"
+#include "platform/WebTaskRunner.h"
#include "platform/audio/AudioUtilities.h"
#include "platform/testing/TestingPlatformSupport.h"
+#include "platform/wtf/Functional.h"
#include "platform/wtf/PtrUtil.h"
+#include "public/platform/Platform.h"
+#include "public/platform/WebThread.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace blink {
@@ -30,22 +35,22 @@ TEST(PushPullFIFOBasicTest, BasicTests) {
// The input bus length must be |AudioUtilities::kRenderQuantumFrames|.
// i.e.) inputBus->length() == kRenderQuantumFrames
- RefPtr<AudioBus> input_bus_of129_frames =
+ RefPtr<AudioBus> input_bus_129_frames =
AudioBus::Create(2, AudioUtilities::kRenderQuantumFrames + 1);
- EXPECT_DEATH(test_fifo->Push(input_bus_of129_frames.Get()), "");
- RefPtr<AudioBus> input_bus_of127_frames =
+ EXPECT_DEATH(test_fifo->Push(input_bus_129_frames.Get()), "");
+ RefPtr<AudioBus> input_bus_127_frames =
AudioBus::Create(2, AudioUtilities::kRenderQuantumFrames - 1);
- EXPECT_DEATH(test_fifo->Push(input_bus_of127_frames.Get()), "");
+ EXPECT_DEATH(test_fifo->Push(input_bus_127_frames.Get()), "");
// Pull request frames cannot exceed the length of output bus.
// i.e.) framesRequested <= outputBus->length()
- RefPtr<AudioBus> output_bus_of512_frames = AudioBus::Create(2, 512);
- EXPECT_DEATH(test_fifo->Pull(output_bus_of512_frames.Get(), 513), "");
+ RefPtr<AudioBus> output_bus_512_frames = AudioBus::Create(2, 512);
+ EXPECT_DEATH(test_fifo->Pull(output_bus_512_frames.Get(), 513), "");
// Pull request frames cannot exceed the length of FIFO.
// i.e.) framesRequested <= m_fifoLength
- RefPtr<AudioBus> output_bus_of1025_frames = AudioBus::Create(2, 1025);
- EXPECT_DEATH(test_fifo->Pull(output_bus_of1025_frames.Get(), 1025), "");
+ RefPtr<AudioBus> output_bus_1025_frames = AudioBus::Create(2, 1025);
+ EXPECT_DEATH(test_fifo->Pull(output_bus_1025_frames.Get(), 1025), "");
}
// Fills each AudioChannel in an AudioBus with a series of linearly increasing
@@ -169,7 +174,8 @@ TEST_P(PushPullFIFOFeatureTest, FeatureTests) {
// Verify in-FIFO samples.
for (const auto& sample : expected_state.fifo_samples) {
- EXPECT_TRUE(VerifyBusValueAtIndex(fifo->Bus(), sample.index, sample.value));
+ EXPECT_TRUE(VerifyBusValueAtIndex(fifo->GetFIFOBusForTest(),
+ sample.index, sample.value));
}
// Verify samples from the most recent output bus.
@@ -357,7 +363,6 @@ FIFOTestParam g_feature_test_params[] = {
INSTANTIATE_TEST_CASE_P(PushPullFIFOFeatureTest,
PushPullFIFOFeatureTest,
::testing::ValuesIn(g_feature_test_params));
-
} // namespace
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698