| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 return directive; | 42 return directive; |
| 43 } | 43 } |
| 44 | 44 |
| 45 } // namespace | 45 } // namespace |
| 46 | 46 |
| 47 class AudioDirectiveHandlerTest : public testing::Test { | 47 class AudioDirectiveHandlerTest : public testing::Test { |
| 48 public: | 48 public: |
| 49 AudioDirectiveHandlerTest() { | 49 AudioDirectiveHandlerTest() { |
| 50 modem_ptr_ = new StubModem; | 50 modem_ptr_ = new StubModem; |
| 51 timer_ptr_ = new base::MockTimer(false, false); | 51 timer_ptr_ = new base::MockTimer(false, false); |
| 52 clock_ptr_ = new base::SimpleTestTickClock; | 52 clock_ptr_ = new base::SimpleTestTickClock(base::TimeTicks()); |
| 53 | 53 |
| 54 directive_handler_.reset(new AudioDirectiveHandlerImpl( | 54 directive_handler_.reset(new AudioDirectiveHandlerImpl( |
| 55 base::Bind(&AudioDirectiveHandlerTest::GetDirectiveUpdates, | 55 base::Bind(&AudioDirectiveHandlerTest::GetDirectiveUpdates, |
| 56 base::Unretained(this)), | 56 base::Unretained(this)), |
| 57 make_scoped_ptr<audio_modem::Modem>(modem_ptr_), | 57 make_scoped_ptr<audio_modem::Modem>(modem_ptr_), |
| 58 make_scoped_ptr<base::Timer>(timer_ptr_), | 58 make_scoped_ptr<base::Timer>(timer_ptr_), |
| 59 make_scoped_refptr(new TickClockRefCounted(clock_ptr_)))); | 59 make_scoped_refptr(new TickClockRefCounted(clock_ptr_)))); |
| 60 directive_handler_->Initialize(nullptr, audio_modem::TokensCallback()); | 60 directive_handler_->Initialize(nullptr, audio_modem::TokensCallback()); |
| 61 } | 61 } |
| 62 ~AudioDirectiveHandlerTest() override {} | 62 ~AudioDirectiveHandlerTest() override {} |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 // Advance to +11ms. | 169 // Advance to +11ms. |
| 170 clock_ptr_->Advance(twoMs); | 170 clock_ptr_->Advance(twoMs); |
| 171 timer_ptr_->Fire(); | 171 timer_ptr_->Fire(); |
| 172 EXPECT_FALSE(IsRecording(AUDIBLE)); | 172 EXPECT_FALSE(IsRecording(AUDIBLE)); |
| 173 } | 173 } |
| 174 | 174 |
| 175 // TODO(rkc): Write more tests that check more convoluted sequences of | 175 // TODO(rkc): Write more tests that check more convoluted sequences of |
| 176 // transmits/receives. | 176 // transmits/receives. |
| 177 | 177 |
| 178 } // namespace copresence | 178 } // namespace copresence |
| OLD | NEW |