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

Side by Side Diff: webrtc/modules/audio_coding/acm2/audio_coding_module_unittest.cc

Issue 3010223002: Update thread annotiation macros in modules to use RTC_ prefix (Closed)
Patch Set: Created 3 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 rtc::CritScope lock(&crit_sect_); 139 rtc::CritScope lock(&crit_sect_);
140 return last_timestamp_; 140 return last_timestamp_;
141 } 141 }
142 142
143 void SwapBuffers(std::vector<uint8_t>* payload) { 143 void SwapBuffers(std::vector<uint8_t>* payload) {
144 rtc::CritScope lock(&crit_sect_); 144 rtc::CritScope lock(&crit_sect_);
145 last_payload_vec_.swap(*payload); 145 last_payload_vec_.swap(*payload);
146 } 146 }
147 147
148 private: 148 private:
149 int num_calls_ GUARDED_BY(crit_sect_); 149 int num_calls_ RTC_GUARDED_BY(crit_sect_);
150 FrameType last_frame_type_ GUARDED_BY(crit_sect_); 150 FrameType last_frame_type_ RTC_GUARDED_BY(crit_sect_);
151 int last_payload_type_ GUARDED_BY(crit_sect_); 151 int last_payload_type_ RTC_GUARDED_BY(crit_sect_);
152 uint32_t last_timestamp_ GUARDED_BY(crit_sect_); 152 uint32_t last_timestamp_ RTC_GUARDED_BY(crit_sect_);
153 std::vector<uint8_t> last_payload_vec_ GUARDED_BY(crit_sect_); 153 std::vector<uint8_t> last_payload_vec_ RTC_GUARDED_BY(crit_sect_);
154 rtc::CriticalSection crit_sect_; 154 rtc::CriticalSection crit_sect_;
155 }; 155 };
156 156
157 class AudioCodingModuleTestOldApi : public ::testing::Test { 157 class AudioCodingModuleTestOldApi : public ::testing::Test {
158 protected: 158 protected:
159 AudioCodingModuleTestOldApi() 159 AudioCodingModuleTestOldApi()
160 : id_(1), 160 : id_(1),
161 rtp_utility_(new RtpUtility(kFrameSizeSamples, kPayloadType)), 161 rtp_utility_(new RtpUtility(kFrameSizeSamples, kPayloadType)),
162 clock_(Clock::GetRealTimeClock()) {} 162 clock_(Clock::GetRealTimeClock()) {}
163 163
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 fake_clock_->AdvanceTimeMilliseconds(10); 600 fake_clock_->AdvanceTimeMilliseconds(10);
601 return true; 601 return true;
602 } 602 }
603 603
604 rtc::PlatformThread send_thread_; 604 rtc::PlatformThread send_thread_;
605 rtc::PlatformThread insert_packet_thread_; 605 rtc::PlatformThread insert_packet_thread_;
606 rtc::PlatformThread pull_audio_thread_; 606 rtc::PlatformThread pull_audio_thread_;
607 const std::unique_ptr<EventWrapper> test_complete_; 607 const std::unique_ptr<EventWrapper> test_complete_;
608 int send_count_; 608 int send_count_;
609 int insert_packet_count_; 609 int insert_packet_count_;
610 int pull_audio_count_ GUARDED_BY(crit_sect_); 610 int pull_audio_count_ RTC_GUARDED_BY(crit_sect_);
611 rtc::CriticalSection crit_sect_; 611 rtc::CriticalSection crit_sect_;
612 int64_t next_insert_packet_time_ms_ GUARDED_BY(crit_sect_); 612 int64_t next_insert_packet_time_ms_ RTC_GUARDED_BY(crit_sect_);
613 std::unique_ptr<SimulatedClock> fake_clock_; 613 std::unique_ptr<SimulatedClock> fake_clock_;
614 }; 614 };
615 615
616 #if defined(WEBRTC_IOS) 616 #if defined(WEBRTC_IOS)
617 #define MAYBE_DoTest DISABLED_DoTest 617 #define MAYBE_DoTest DISABLED_DoTest
618 #else 618 #else
619 #define MAYBE_DoTest DoTest 619 #define MAYBE_DoTest DoTest
620 #endif 620 #endif
621 TEST_F(AudioCodingModuleMtTestOldApi, MAYBE_DoTest) { 621 TEST_F(AudioCodingModuleMtTestOldApi, MAYBE_DoTest) {
622 EXPECT_EQ(kEventSignaled, RunTest()); 622 EXPECT_EQ(kEventSignaled, RunTest());
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 if (codec_registered_ && receive_packet_count_ > kNumPackets) { 872 if (codec_registered_ && receive_packet_count_ > kNumPackets) {
873 test_complete_->Set(); 873 test_complete_->Set();
874 } 874 }
875 return true; 875 return true;
876 } 876 }
877 877
878 rtc::PlatformThread receive_thread_; 878 rtc::PlatformThread receive_thread_;
879 rtc::PlatformThread codec_registration_thread_; 879 rtc::PlatformThread codec_registration_thread_;
880 const std::unique_ptr<EventWrapper> test_complete_; 880 const std::unique_ptr<EventWrapper> test_complete_;
881 rtc::CriticalSection crit_sect_; 881 rtc::CriticalSection crit_sect_;
882 bool codec_registered_ GUARDED_BY(crit_sect_); 882 bool codec_registered_ RTC_GUARDED_BY(crit_sect_);
883 int receive_packet_count_ GUARDED_BY(crit_sect_); 883 int receive_packet_count_ RTC_GUARDED_BY(crit_sect_);
884 int64_t next_insert_packet_time_ms_ GUARDED_BY(crit_sect_); 884 int64_t next_insert_packet_time_ms_ RTC_GUARDED_BY(crit_sect_);
885 std::unique_ptr<AudioEncoderIsacFloatImpl> isac_encoder_; 885 std::unique_ptr<AudioEncoderIsacFloatImpl> isac_encoder_;
886 std::unique_ptr<SimulatedClock> fake_clock_; 886 std::unique_ptr<SimulatedClock> fake_clock_;
887 test::AudioLoop audio_loop_; 887 test::AudioLoop audio_loop_;
888 }; 888 };
889 889
890 #if defined(WEBRTC_IOS) 890 #if defined(WEBRTC_IOS)
891 #define MAYBE_DoTest DISABLED_DoTest 891 #define MAYBE_DoTest DISABLED_DoTest
892 #else 892 #else
893 #define MAYBE_DoTest DoTest 893 #define MAYBE_DoTest DoTest
894 #endif 894 #endif
(...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after
1956 Run(16000, 8000, 1000); 1956 Run(16000, 8000, 1000);
1957 } 1957 }
1958 1958
1959 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) { 1959 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) {
1960 Run(8000, 16000, 1000); 1960 Run(8000, 16000, 1000);
1961 } 1961 }
1962 1962
1963 #endif 1963 #endif
1964 1964
1965 } // namespace webrtc 1965 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698