OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 TEST(Expand, CreateUsingFactory) { | 37 TEST(Expand, CreateUsingFactory) { |
38 int fs = 8000; | 38 int fs = 8000; |
39 size_t channels = 1; | 39 size_t channels = 1; |
40 BackgroundNoise bgn(channels); | 40 BackgroundNoise bgn(channels); |
41 SyncBuffer sync_buffer(1, 1000); | 41 SyncBuffer sync_buffer(1, 1000); |
42 RandomVector random_vector; | 42 RandomVector random_vector; |
43 StatisticsCalculator statistics; | 43 StatisticsCalculator statistics; |
44 ExpandFactory expand_factory; | 44 ExpandFactory expand_factory; |
45 Expand* expand = expand_factory.Create(&bgn, &sync_buffer, &random_vector, | 45 Expand* expand = expand_factory.Create(&bgn, &sync_buffer, &random_vector, |
46 &statistics, fs, channels); | 46 &statistics, fs, channels); |
47 EXPECT_TRUE(expand != NULL); | 47 EXPECT_TRUE(expand != nullptr); |
48 delete expand; | 48 delete expand; |
49 } | 49 } |
50 | 50 |
51 namespace { | 51 namespace { |
52 class FakeStatisticsCalculator : public StatisticsCalculator { | 52 class FakeStatisticsCalculator : public StatisticsCalculator { |
53 public: | 53 public: |
54 void LogDelayedPacketOutageEvent(int outage_duration_ms) override { | 54 void LogDelayedPacketOutageEvent(int outage_duration_ms) override { |
55 last_outage_duration_ms_ = outage_duration_ms; | 55 last_outage_duration_ms_ = outage_duration_ms; |
56 } | 56 } |
57 | 57 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 197 |
198 expand_.Reset(); // Must reset in order to start a new expand period. | 198 expand_.Reset(); // Must reset in order to start a new expand period. |
199 ExpandUntilMuted(num_channels_, &expand_); | 199 ExpandUntilMuted(num_channels_, &expand_); |
200 expand_.SetParametersForNormalAfterExpand(); | 200 expand_.SetParametersForNormalAfterExpand(); |
201 EXPECT_FALSE(expand_.Muted()); // Should be back to unmuted. | 201 EXPECT_FALSE(expand_.Muted()); // Should be back to unmuted. |
202 } | 202 } |
203 | 203 |
204 // TODO(hlundin): Write more tests. | 204 // TODO(hlundin): Write more tests. |
205 | 205 |
206 } // namespace webrtc | 206 } // namespace webrtc |
OLD | NEW |