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

Side by Side Diff: cc/scheduler/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
« no previous file with comments | « cc/scheduler/begin_frame_source_unittest.cc ('k') | cc/surfaces/display_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 "cc/scheduler/scheduler.h" 5 #include "cc/scheduler/scheduler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 return CallOnBeginFrame(args); 232 return CallOnBeginFrame(args);
233 } 233 }
234 234
235 private: 235 private:
236 FakeSchedulerClient* client_; 236 FakeSchedulerClient* client_;
237 }; 237 };
238 238
239 class SchedulerTest : public testing::Test { 239 class SchedulerTest : public testing::Test {
240 public: 240 public:
241 SchedulerTest() 241 SchedulerTest()
242 : now_src_(new base::SimpleTestTickClock()), 242 : now_src_(new base::SimpleTestTickClock(
243 base::TimeTicks() + base::TimeDelta::FromMicroseconds(1))),
243 task_runner_(new OrderedSimpleTaskRunner(now_src_.get(), true)), 244 task_runner_(new OrderedSimpleTaskRunner(now_src_.get(), true)),
244 fake_external_begin_frame_source_(nullptr) { 245 fake_external_begin_frame_source_(nullptr) {
245 now_src_->Advance(base::TimeDelta::FromMicroseconds(10000));
246 // A bunch of tests require NowTicks() 246 // A bunch of tests require NowTicks()
247 // to be > BeginFrameArgs::DefaultInterval() 247 // to be > BeginFrameArgs::DefaultInterval()
248 now_src_->Advance(base::TimeDelta::FromMilliseconds(100)); 248 now_src_->Advance(base::TimeDelta::FromMilliseconds(100));
249 // Fail if we need to run 100 tasks in a row. 249 // Fail if we need to run 100 tasks in a row.
250 task_runner_->SetRunTaskLimit(100); 250 task_runner_->SetRunTaskLimit(100);
251 } 251 }
252 252
253 ~SchedulerTest() override {} 253 ~SchedulerTest() override {}
254 254
255 protected: 255 protected:
(...skipping 3298 matching lines...) Expand 10 before | Expand all | Expand 10 after
3554 } 3554 }
3555 3555
3556 TEST_F(SchedulerTest, BeginMainFrameOnCriticalPath_AHS) { 3556 TEST_F(SchedulerTest, BeginMainFrameOnCriticalPath_AHS) {
3557 EXPECT_FALSE(BeginMainFrameOnCriticalPath( 3557 EXPECT_FALSE(BeginMainFrameOnCriticalPath(
3558 SMOOTHNESS_TAKES_PRIORITY, 3558 SMOOTHNESS_TAKES_PRIORITY,
3559 ScrollHandlerState::SCROLL_AFFECTS_SCROLL_HANDLER, kSlowDuration)); 3559 ScrollHandlerState::SCROLL_AFFECTS_SCROLL_HANDLER, kSlowDuration));
3560 } 3560 }
3561 3561
3562 } // namespace 3562 } // namespace
3563 } // namespace cc 3563 } // namespace cc
OLDNEW
« no previous file with comments | « cc/scheduler/begin_frame_source_unittest.cc ('k') | cc/surfaces/display_scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698