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

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: Addressed comment 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
« no previous file with comments | « remoting/host/audio_capturer_win.cc ('k') | remoting/remoting.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
7 #include "base/basictypes.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9
10 namespace remoting {
11
12 TEST(AudioCapturerWinTest, SilenceTest) {
13 int16 samples1[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
14 int16 samples2[] = {65, 73, 83, 89, 92, -1, 5, 9, 123, 0};
15 int16 samples3[] = {0, 0, 0, 0, 1, 0, 0, -1, 0, 0};
16 // MSVC++ doesn't allow allocating arrays of size 0.
17 int16 samples4[] = {0};
18
19 ASSERT_TRUE(
20 AudioCapturerWin::IsPacketOfSilence(samples1, arraysize(samples1)));
21 ASSERT_FALSE(
22 AudioCapturerWin::IsPacketOfSilence(samples2, arraysize(samples2)));
23 ASSERT_TRUE(
24 AudioCapturerWin::IsPacketOfSilence(samples3, arraysize(samples3)));
25 ASSERT_TRUE(
26 AudioCapturerWin::IsPacketOfSilence(samples4, 0));
27 }
28
29 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/audio_capturer_win.cc ('k') | remoting/remoting.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698