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

Side by Side Diff: remoting/host/audio_capturer_win_unittest.cc

Issue 10823440: Silence detection test for the Windows audio capturer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "remoting/host/audio_capturer_win.h"
6 #include "testing/gtest/include/gtest/gtest.h"
Sergey Ulanov 2012/08/21 20:52:15 move this include after basictypes.h
kxing 2012/08/21 21:24:27 Done.
7
8 #include "base/basictypes.h"
9
10 namespace remoting {
11
12 class AudioCapturerWinTest : public testing::Test {
Sergey Ulanov 2012/08/21 20:52:15 Don't really need this class. It's necessary only
kxing 2012/08/21 21:24:27 Done.
13 };
14
15 TEST_F(AudioCapturerWinTest, SilenceTest) {
16 int16 samples1[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
Sergey Ulanov 2012/08/21 20:52:15 Maybe add a test for an empty buffer?
kxing 2012/08/21 21:24:27 Done.
17 int16 samples2[] = {65, 73, 83, 89, 92, -1, 5, 9, 123, 0};
18 int16 samples3[] = {0, 0, 0, 0, 1, 0, 0, -1, 0, 0};
19
20 ASSERT_TRUE(AudioCapturerWin::IsPacketOfSilence(samples1, 10));
Sergey Ulanov 2012/08/21 20:52:15 here and below: s/10/arraysize(samples1)/
kxing 2012/08/21 21:24:27 Done.
21 ASSERT_FALSE(AudioCapturerWin::IsPacketOfSilence(samples2, 10));
22 ASSERT_TRUE(AudioCapturerWin::IsPacketOfSilence(samples3, 10));
23 }
24
25 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698