OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2004 Google Inc. | 3 * Copyright 2004 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 mode_ = -1; | 790 mode_ = -1; |
791 error_ = cricket::SrtpFilter::ERROR_NONE; | 791 error_ = cricket::SrtpFilter::ERROR_NONE; |
792 } | 792 } |
793 | 793 |
794 cricket::SrtpStat srtp_stat_; | 794 cricket::SrtpStat srtp_stat_; |
795 uint32 ssrc_; | 795 uint32 ssrc_; |
796 int mode_; | 796 int mode_; |
797 cricket::SrtpFilter::Error error_; | 797 cricket::SrtpFilter::Error error_; |
798 | 798 |
799 private: | 799 private: |
800 DISALLOW_COPY_AND_ASSIGN(SrtpStatTest); | 800 RTC_DISALLOW_COPY_AND_ASSIGN(SrtpStatTest); |
801 }; | 801 }; |
802 | 802 |
803 TEST_F(SrtpStatTest, TestProtectRtpError) { | 803 TEST_F(SrtpStatTest, TestProtectRtpError) { |
804 Reset(); | 804 Reset(); |
805 srtp_stat_.AddProtectRtpResult(1, err_status_ok); | 805 srtp_stat_.AddProtectRtpResult(1, err_status_ok); |
806 EXPECT_EQ(0U, ssrc_); | 806 EXPECT_EQ(0U, ssrc_); |
807 EXPECT_EQ(-1, mode_); | 807 EXPECT_EQ(-1, mode_); |
808 EXPECT_EQ(cricket::SrtpFilter::ERROR_NONE, error_); | 808 EXPECT_EQ(cricket::SrtpFilter::ERROR_NONE, error_); |
809 Reset(); | 809 Reset(); |
810 srtp_stat_.AddProtectRtpResult(1, err_status_auth_fail); | 810 srtp_stat_.AddProtectRtpResult(1, err_status_auth_fail); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 srtp_stat_.AddUnprotectRtcpResult(err_status_fail); | 926 srtp_stat_.AddUnprotectRtcpResult(err_status_fail); |
927 EXPECT_EQ(-1, mode_); | 927 EXPECT_EQ(-1, mode_); |
928 EXPECT_EQ(cricket::SrtpFilter::ERROR_NONE, error_); | 928 EXPECT_EQ(cricket::SrtpFilter::ERROR_NONE, error_); |
929 // Now the error will be triggered again. | 929 // Now the error will be triggered again. |
930 Reset(); | 930 Reset(); |
931 rtc::Thread::Current()->SleepMs(210); | 931 rtc::Thread::Current()->SleepMs(210); |
932 srtp_stat_.AddUnprotectRtcpResult(err_status_fail); | 932 srtp_stat_.AddUnprotectRtcpResult(err_status_fail); |
933 EXPECT_EQ(cricket::SrtpFilter::UNPROTECT, mode_); | 933 EXPECT_EQ(cricket::SrtpFilter::UNPROTECT, mode_); |
934 EXPECT_EQ(cricket::SrtpFilter::ERROR_FAIL, error_); | 934 EXPECT_EQ(cricket::SrtpFilter::ERROR_FAIL, error_); |
935 } | 935 } |
OLD | NEW |