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

Side by Side Diff: remoting/protocol/capture_scheduler_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, 12 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "remoting/protocol/capture_scheduler.h" 5 #include "remoting/protocol/capture_scheduler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 12 matching lines...) Expand all
23 23
24 class CaptureSchedulerTest : public testing::Test { 24 class CaptureSchedulerTest : public testing::Test {
25 public: 25 public:
26 CaptureSchedulerTest() : capture_called_(false) {} 26 CaptureSchedulerTest() : capture_called_(false) {}
27 27
28 void InitScheduler() { 28 void InitScheduler() {
29 scheduler_.reset(new CaptureScheduler( 29 scheduler_.reset(new CaptureScheduler(
30 base::Bind(&CaptureSchedulerTest::DoCapture, base::Unretained(this)))); 30 base::Bind(&CaptureSchedulerTest::DoCapture, base::Unretained(this))));
31 scheduler_->set_minimum_interval( 31 scheduler_->set_minimum_interval(
32 base::TimeDelta::FromMilliseconds(kMinumumFrameIntervalMs)); 32 base::TimeDelta::FromMilliseconds(kMinumumFrameIntervalMs));
33 tick_clock_ = new base::SimpleTestTickClock(); 33 tick_clock_ = new base::SimpleTestTickClock(base::TimeTicks());
34 scheduler_->SetTickClockForTest(make_scoped_ptr(tick_clock_)); 34 scheduler_->SetTickClockForTest(make_scoped_ptr(tick_clock_));
35 capture_timer_ = new base::MockTimer(false, false); 35 capture_timer_ = new base::MockTimer(false, false);
36 scheduler_->SetTimerForTest(make_scoped_ptr(capture_timer_)); 36 scheduler_->SetTimerForTest(make_scoped_ptr(capture_timer_));
37 scheduler_->Start(); 37 scheduler_->Start();
38 } 38 }
39 39
40 void DoCapture() { 40 void DoCapture() {
41 capture_called_ = true; 41 capture_called_ = true;
42 } 42 }
43 43
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 193
194 // Next frame should be scheduled, once one of the queued frames is 194 // Next frame should be scheduled, once one of the queued frames is
195 // acknowledged. 195 // acknowledged.
196 EXPECT_FALSE(capture_timer_->IsRunning()); 196 EXPECT_FALSE(capture_timer_->IsRunning());
197 scheduler_->ProcessVideoAck(make_scoped_ptr(new VideoAck())); 197 scheduler_->ProcessVideoAck(make_scoped_ptr(new VideoAck()));
198 EXPECT_TRUE(capture_timer_->IsRunning()); 198 EXPECT_TRUE(capture_timer_->IsRunning());
199 } 199 }
200 200
201 } // namespace protocol 201 } // namespace protocol
202 } // namespace remoting 202 } // namespace remoting
OLDNEW
« no previous file with comments | « mojo/message_pump/handle_watcher_unittest.cc ('k') | ui/chromeos/touch_exploration_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698