| Index: content/renderer/media/media_stream_audio_processor_unittest.cc
|
| diff --git a/content/renderer/media/media_stream_audio_processor_unittest.cc b/content/renderer/media/media_stream_audio_processor_unittest.cc
|
| index 5c86e6c88ca8715626d2772e6b159ca77c77e16b..5a1d7a84c705966534ebb7e1b7bafffc27a77854 100644
|
| --- a/content/renderer/media/media_stream_audio_processor_unittest.cc
|
| +++ b/content/renderer/media/media_stream_audio_processor_unittest.cc
|
| @@ -2,6 +2,8 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include <vector>
|
| +
|
| #include "base/files/file_path.h"
|
| #include "base/files/file_util.h"
|
| #include "base/logging.h"
|
| @@ -525,4 +527,35 @@ TEST_F(MediaStreamAudioProcessorTest, MAYBE_TestWithKeyboardMicChannel) {
|
| audio_processor = NULL;
|
| }
|
|
|
| +using Point = webrtc::Point;
|
| +using PointVector = std::vector<Point>;
|
| +
|
| +void ExpectPointVectorEqual(const PointVector& expected,
|
| + const PointVector& actual) {
|
| + EXPECT_EQ(expected.size(), actual.size());
|
| + for (size_t i = 0; i < actual.size(); ++i) {
|
| + EXPECT_EQ(expected[i].x(), actual[i].x());
|
| + EXPECT_EQ(expected[i].y(), actual[i].y());
|
| + EXPECT_EQ(expected[i].z(), actual[i].z());
|
| + }
|
| +}
|
| +
|
| +TEST(MediaStreamAudioProcessorOptionsTest, ParseArrayGeometry) {
|
| + const PointVector expected_empty;
|
| + ExpectPointVectorEqual(expected_empty, ParseArrayGeometry(""));
|
| + ExpectPointVectorEqual(expected_empty, ParseArrayGeometry("0 0 a"));
|
| + ExpectPointVectorEqual(expected_empty, ParseArrayGeometry("1 2"));
|
| + ExpectPointVectorEqual(expected_empty, ParseArrayGeometry("1 2 3 4"));
|
| +
|
| + {
|
| + PointVector expected(1, Point(-0.02f, 0, 0));
|
| + expected.push_back(Point(0.02f, 0, 0));
|
| + ExpectPointVectorEqual(expected, ParseArrayGeometry("-0.02 0 0 0.02 0 0"));
|
| + }
|
| + {
|
| + PointVector expected(1, Point(1, 2, 3));
|
| + ExpectPointVectorEqual(expected, ParseArrayGeometry("1 2 3"));
|
| + }
|
| +}
|
| +
|
| } // namespace content
|
|
|