Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 | |
| OLD | NEW |