| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 void AddCanInsertDtmfTrack(const std::string& label) { | 125 void AddCanInsertDtmfTrack(const std::string& label) { |
| 126 can_insert_dtmf_tracks_.insert(label); | 126 can_insert_dtmf_tracks_.insert(label); |
| 127 } | 127 } |
| 128 void RemoveCanInsertDtmfTrack(const std::string& label) { | 128 void RemoveCanInsertDtmfTrack(const std::string& label) { |
| 129 can_insert_dtmf_tracks_.erase(label); | 129 can_insert_dtmf_tracks_.erase(label); |
| 130 } | 130 } |
| 131 | 131 |
| 132 private: | 132 private: |
| 133 std::set<std::string> can_insert_dtmf_tracks_; | 133 std::set<std::string> can_insert_dtmf_tracks_; |
| 134 std::vector<DtmfInfo> dtmf_info_queue_; | 134 std::vector<DtmfInfo> dtmf_info_queue_; |
| 135 int64 last_insert_dtmf_call_; | 135 int64_t last_insert_dtmf_call_; |
| 136 sigslot::signal0<> SignalDestroyed; | 136 sigslot::signal0<> SignalDestroyed; |
| 137 }; | 137 }; |
| 138 | 138 |
| 139 class DtmfSenderTest : public testing::Test { | 139 class DtmfSenderTest : public testing::Test { |
| 140 protected: | 140 protected: |
| 141 DtmfSenderTest() | 141 DtmfSenderTest() |
| 142 : track_(AudioTrack::Create(kTestAudioLabel, NULL)), | 142 : track_(AudioTrack::Create(kTestAudioLabel, NULL)), |
| 143 observer_(new rtc::RefCountedObject<FakeDtmfObserver>()), | 143 observer_(new rtc::RefCountedObject<FakeDtmfObserver>()), |
| 144 provider_(new FakeDtmfProvider()) { | 144 provider_(new FakeDtmfProvider()) { |
| 145 provider_->AddCanInsertDtmfTrack(kTestAudioLabel); | 145 provider_->AddCanInsertDtmfTrack(kTestAudioLabel); |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 std::string tones = "3,4"; | 350 std::string tones = "3,4"; |
| 351 int duration = 100; | 351 int duration = 100; |
| 352 int inter_tone_gap = 50; | 352 int inter_tone_gap = 50; |
| 353 | 353 |
| 354 EXPECT_FALSE(dtmf_->InsertDtmf(tones, 6001, inter_tone_gap)); | 354 EXPECT_FALSE(dtmf_->InsertDtmf(tones, 6001, inter_tone_gap)); |
| 355 EXPECT_FALSE(dtmf_->InsertDtmf(tones, 69, inter_tone_gap)); | 355 EXPECT_FALSE(dtmf_->InsertDtmf(tones, 69, inter_tone_gap)); |
| 356 EXPECT_FALSE(dtmf_->InsertDtmf(tones, duration, 49)); | 356 EXPECT_FALSE(dtmf_->InsertDtmf(tones, duration, 49)); |
| 357 | 357 |
| 358 EXPECT_TRUE(dtmf_->InsertDtmf(tones, duration, inter_tone_gap)); | 358 EXPECT_TRUE(dtmf_->InsertDtmf(tones, duration, inter_tone_gap)); |
| 359 } | 359 } |
| OLD | NEW |