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

Side by Side Diff: cc/scheduler/begin_frame_source_unittest.cc

Issue 1178423008: Provision to start base::SimpleTestTickClock at initial ticks Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « base/test/simple_test_tick_clock.cc ('k') | cc/scheduler/scheduler_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 <deque> 5 #include <deque>
6 #include <string> 6 #include <string>
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/gtest_prod_util.h" 9 #include "base/gtest_prod_util.h"
10 #include "base/test/test_simple_task_runner.h" 10 #include "base/test/test_simple_task_runner.h"
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 static const int64_t kDeadline; 336 static const int64_t kDeadline;
337 static const int64_t kInterval; 337 static const int64_t kInterval;
338 338
339 scoped_ptr<base::SimpleTestTickClock> now_src_; 339 scoped_ptr<base::SimpleTestTickClock> now_src_;
340 scoped_refptr<OrderedSimpleTaskRunner> task_runner_; 340 scoped_refptr<OrderedSimpleTaskRunner> task_runner_;
341 scoped_ptr<TestBackToBackBeginFrameSource> source_; 341 scoped_ptr<TestBackToBackBeginFrameSource> source_;
342 scoped_ptr<MockBeginFrameObserver> obs_; 342 scoped_ptr<MockBeginFrameObserver> obs_;
343 343
344 void SetUp() override { 344 void SetUp() override {
345 now_src_.reset(new base::SimpleTestTickClock()); 345 now_src_.reset(new base::SimpleTestTickClock());
346 now_src_->Advance(base::TimeDelta::FromMicroseconds(1000)); 346 // SimpleTestTickClock starts at 1 microsecond, advance to 1000
347 now_src_->Advance(base::TimeDelta::FromMicroseconds(999));
Sami 2015/06/18 20:57:43 It feels like having two constructor for SimpleTes
Ankur Verma 2015/06/30 09:19:26 Done.
347 task_runner_ = 348 task_runner_ =
348 make_scoped_refptr(new OrderedSimpleTaskRunner(now_src_.get(), false)); 349 make_scoped_refptr(new OrderedSimpleTaskRunner(now_src_.get(), false));
349 task_runner_->SetRunTaskLimit(1); 350 task_runner_->SetRunTaskLimit(1);
350 source_ = TestBackToBackBeginFrameSource::Create(now_src_.get(), 351 source_ = TestBackToBackBeginFrameSource::Create(now_src_.get(),
351 task_runner_.get()); 352 task_runner_.get());
352 obs_ = make_scoped_ptr(new ::testing::StrictMock<MockBeginFrameObserver>()); 353 obs_ = make_scoped_ptr(new ::testing::StrictMock<MockBeginFrameObserver>());
353 source_->AddObserver(obs_.get()); 354 source_->AddObserver(obs_.get());
354 } 355 }
355 356
356 void TearDown() override { obs_.reset(); } 357 void TearDown() override { obs_.reset(); }
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 mux_->SetActiveSource(source2_); 771 mux_->SetActiveSource(source2_);
771 SEND_BEGIN_FRAME_DROP(*source2_, 750, 1050, 300); 772 SEND_BEGIN_FRAME_DROP(*source2_, 750, 1050, 300);
772 SEND_BEGIN_FRAME_USED(*source2_, 1050, 1250, 300); 773 SEND_BEGIN_FRAME_USED(*source2_, 1050, 1250, 300);
773 774
774 mux_->SetActiveSource(source1_); 775 mux_->SetActiveSource(source1_);
775 SEND_BEGIN_FRAME_DROP(*source2_, 1100, 1400, 300); 776 SEND_BEGIN_FRAME_DROP(*source2_, 1100, 1400, 300);
776 } 777 }
777 778
778 } // namespace 779 } // namespace
779 } // namespace cc 780 } // namespace cc
OLDNEW
« no previous file with comments | « base/test/simple_test_tick_clock.cc ('k') | cc/scheduler/scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698