Index: components/copresence/test/audio_test_support.h |
diff --git a/components/copresence/test/audio_test_support.h b/components/copresence/test/audio_test_support.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..83b96f4a30ce71213579114efda647ad188603f7 |
--- /dev/null |
+++ b/components/copresence/test/audio_test_support.h |
@@ -0,0 +1,34 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef COMPONENTS_COPRESENCE_COMMON_AUDIO_TEST_SUPPORT_ |
+#define COMPONENTS_COPRESENCE_COMMON_AUDIO_TEST_SUPPORT_ |
+ |
+#include <cstddef> |
+ |
+#include "base/memory/ref_counted.h" |
+#include "base/memory/scoped_ptr.h" |
+ |
+namespace media { |
+class AudioBus; |
+class AudioBusRefCounted; |
+} |
+ |
+namespace copresence { |
+ |
+// Populate random samples given a random seed into the samples array. |
+void PopulateSamples(int random_seed, size_t size, float* samples); |
+ |
+// Create an audio bus populated with random samples. |
+scoped_ptr<media::AudioBus> CreateRandomAudio(int random_seed, |
+ int channels, |
+ int samples); |
+ |
+// Create an ref counted audio bus populated with random samples. |
+scoped_refptr<media::AudioBusRefCounted> |
+ CreateRandomAudioRefCounted(int random_seed, int channels, int samples); |
+ |
+} // namespace copresence |
+ |
+#endif // COMPONENTS_COPRESENCE_COMMON_AUDIO_TEST_SUPPORT_ |