summaryrefslogtreecommitdiffstats
path: root/cc/scheduler/scheduler_state_machine.h
diff options
context:
space:
mode:
authormithro <mithro@mithis.com>2014-12-17 23:58:10 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-18 07:58:46 +0000
commit470773ff4b7a5544f5bb044d55f42137c44bf0c7 (patch)
treed0c656c9d4c6b5256dfc198973a2468fd5742f8e /cc/scheduler/scheduler_state_machine.h
parent9ec83fed38ccf52961b6bd3215d0d20dfc013eb4 (diff)
downloadchromium_src-470773ff4b7a5544f5bb044d55f42137c44bf0c7.zip
chromium_src-470773ff4b7a5544f5bb044d55f42137c44bf0c7.tar.gz
chromium_src-470773ff4b7a5544f5bb044d55f42137c44bf0c7.tar.bz2
cc: Removing 127 lines of duplicate code in scheduler_unittest.cc
* Move the InitializeOutputSurfaceAndFirstCommit to a member function of the FakeSchedulerClient. * Moved a lot of duplicate code into the InitializeOutputSurfaceAndFirstCommit function. * Added EXPECT_SCOPED macro to make the functions on FakeSchedulerClient which use the EXPECT macros include a reference to the line number which actually caused the failure. Super useful when the function is called multiple times in a test so you need to determine which call is failing. * Add and use PushAction function on FakeSchedulerClient to prevent accidentally not also pushing the scheduler state (and thus causing a segfault). BUG=416749 Review URL: https://codereview.chromium.org/809723003 Cr-Commit-Position: refs/heads/master@{#308965}
Diffstat (limited to 'cc/scheduler/scheduler_state_machine.h')
-rw-r--r--cc/scheduler/scheduler_state_machine.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/cc/scheduler/scheduler_state_machine.h b/cc/scheduler/scheduler_state_machine.h
index 4d7bf6f..b579998 100644
--- a/cc/scheduler/scheduler_state_machine.h
+++ b/cc/scheduler/scheduler_state_machine.h
@@ -211,6 +211,8 @@ class CC_EXPORT SchedulerStateMachine {
// Set that we can create the first OutputSurface and start the scheduler.
void SetCanStart() { can_start_ = true; }
+ // Allow access of the can_start_ state in tests.
+ bool CanStartForTesting() const { return can_start_; }
void SetSkipNextBeginMainFrameToReduceLatency();