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

Unified Diff: content/renderer/media/media_stream_audio_processor_unittest.cc

Issue 1224623014: Refactor ParseArrayGeometry to use standard Chromium facilities. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CONTEXT_EXPORT on declaration... Created 5 years, 4 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
« no previous file with comments | « content/renderer/media/media_stream_audio_processor_options.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « content/renderer/media/media_stream_audio_processor_options.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698