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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 15058004: cc: Rename VSync to BeginFrame (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix test compiler errors Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: cc/trees/layer_tree_host_unittest.cc
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 2aac01e00ab02b7d5bee6c6e9576c70c2b57d7a9..25ab7057afbfea0fee8d9b9d05d09e8caaa19079 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -2302,11 +2302,11 @@ class LayerTreeHostTestLCDNotification : public LayerTreeHostTest {
SINGLE_THREAD_TEST_F(LayerTreeHostTestLCDNotification);
-// Verify that the vsync notification is used to initiate rendering.
-class LayerTreeHostTestVSyncNotification : public LayerTreeHostTest {
+// Verify that the BeginFrame notification is used to initiate rendering.
+class LayerTreeHostTestBeginFrameNotification : public LayerTreeHostTest {
public:
virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
- settings->render_vsync_notification_enabled = true;
+ settings->render_begin_frame_notification_enabled = true;
}
virtual void BeginTest() OVERRIDE {
@@ -2317,23 +2317,23 @@ class LayerTreeHostTestVSyncNotification : public LayerTreeHostTest {
FakeOutputSurface* fake_output_surface =
reinterpret_cast<FakeOutputSurface*>(host_impl->output_surface());
- // The vsync notification is turned off now but will get enabled once we
- // return, so post a task to trigger it.
- ASSERT_FALSE(fake_output_surface->vsync_notification_enabled());
- PostVSyncOnImplThread(fake_output_surface);
+ // The BeginFrame notification is turned off now but will get enabled once
+ // we return, so post a task to trigger it.
+ ASSERT_FALSE(fake_output_surface->begin_frame_notification_enabled());
+ PostBeginFrameOnImplThread(fake_output_surface);
}
- void PostVSyncOnImplThread(FakeOutputSurface* fake_output_surface) {
+ void PostBeginFrameOnImplThread(FakeOutputSurface* fake_output_surface) {
DCHECK(ImplThread());
ImplThread()->PostTask(
- base::Bind(&LayerTreeHostTestVSyncNotification::DidVSync,
+ base::Bind(&LayerTreeHostTestBeginFrameNotification::BeginFrame,
base::Unretained(this),
base::Unretained(fake_output_surface)));
}
- void DidVSync(FakeOutputSurface* fake_output_surface) {
- ASSERT_TRUE(fake_output_surface->vsync_notification_enabled());
- fake_output_surface->DidVSync(frame_time_);
+ void BeginFrame(FakeOutputSurface* fake_output_surface) {
+ ASSERT_TRUE(fake_output_surface->begin_frame_notification_enabled());
+ fake_output_surface->BeginFrame(frame_time_);
}
virtual bool PrepareToDrawOnThread(
@@ -2350,34 +2350,36 @@ class LayerTreeHostTestVSyncNotification : public LayerTreeHostTest {
base::TimeTicks frame_time_;
};
-MULTI_THREAD_TEST_F(LayerTreeHostTestVSyncNotification);
+MULTI_THREAD_TEST_F(LayerTreeHostTestBeginFrameNotification);
-class LayerTreeHostTestVSyncNotificationShutdownWhileEnabled
+class LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled
: public LayerTreeHostTest {
public:
virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
- settings->render_vsync_notification_enabled = true;
- settings->synchronously_disable_vsync = true;
+ settings->render_begin_frame_notification_enabled = true;
+ settings->using_synchronous_renderer_compositor = true;
}
virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
- // The vsync notification is turned off now but will get enabled once we
- // return. End test while it's enabled.
+ // The BeginFrame notification is turned off now but will get enabled once
+ // we return. End test while it's enabled.
ImplThread()->PostTask(base::Bind(
- &LayerTreeHostTestVSyncNotification::EndTest, base::Unretained(this)));
+ &LayerTreeHostTestBeginFrameNotification::EndTest,
+ base::Unretained(this)));
}
virtual void AfterTest() OVERRIDE {}
};
-MULTI_THREAD_TEST_F(LayerTreeHostTestVSyncNotificationShutdownWhileEnabled);
+MULTI_THREAD_TEST_F(
+ LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled);
class LayerTreeHostTestInputDrivenRendering : public LayerTreeHostTest {
public:
virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
- settings->render_vsync_notification_enabled = true;
+ settings->render_begin_frame_notification_enabled = true;
}
virtual void BeginTest() OVERRIDE {
@@ -2386,7 +2388,7 @@ class LayerTreeHostTestInputDrivenRendering : public LayerTreeHostTest {
}
virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
- // Post a task to send the final input event for the current vsync; it
+ // Post a task to send the final input event for the current BeginFrame; it
// should trigger rendering.
ImplThread()->PostTask(
base::Bind(&LayerTreeHostTestInputDrivenRendering::SendFinalInputEvent,
@@ -2395,7 +2397,7 @@ class LayerTreeHostTestInputDrivenRendering : public LayerTreeHostTest {
}
void SendFinalInputEvent(LayerTreeHostImpl* host_impl) {
- host_impl->DidReceiveLastInputEventForVSync(frame_time_);
+ host_impl->DidReceiveLastInputEventForBeginFrame(frame_time_);
}
virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {

Powered by Google App Engine
This is Rietveld 408576698