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

Side by Side Diff: components/copresence/handlers/audio/audio_directive_handler_unittest.cc

Issue 1178423008: Provision to start base::SimpleTestTickClock at initial ticks Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 11 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 // 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
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
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
OLDNEW
« no previous file with comments | « chrome/renderer/media/cast_ipc_dispatcher_unittest.cc ('k') | components/copresence/timed_map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698