OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/audio/audio_streams_tracker.h" | 5 #include "media/audio/audio_streams_tracker.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
7 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
8 | 10 |
9 namespace media { | 11 namespace media { |
10 | 12 |
11 TEST(AudioStreamsTrackerTest, IncreaseAndDecreaseOnce) { | 13 TEST(AudioStreamsTrackerTest, IncreaseAndDecreaseOnce) { |
12 AudioStreamsTracker audio_streams_tracker; | 14 AudioStreamsTracker audio_streams_tracker; |
13 const size_t kNumberOfOperations = 5; | 15 const size_t kNumberOfOperations = 5; |
14 | 16 |
15 // Increase count. | 17 // Increase count. |
16 for (size_t i = 1; i <= kNumberOfOperations; ++i) { | 18 for (size_t i = 1; i <= kNumberOfOperations; ++i) { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 EXPECT_EQ(2 * kNumberOfOperations, | 92 EXPECT_EQ(2 * kNumberOfOperations, |
91 audio_streams_tracker.max_stream_count()); | 93 audio_streams_tracker.max_stream_count()); |
92 } | 94 } |
93 | 95 |
94 // Reset and check max count. | 96 // Reset and check max count. |
95 audio_streams_tracker.ResetMaxStreamCount(); | 97 audio_streams_tracker.ResetMaxStreamCount(); |
96 EXPECT_EQ(0u, audio_streams_tracker.max_stream_count()); | 98 EXPECT_EQ(0u, audio_streams_tracker.max_stream_count()); |
97 } | 99 } |
98 | 100 |
99 } // namespace media | 101 } // namespace media |
OLD | NEW |