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

Side by Side Diff: cc/trees/layer_tree_host_unittest_no_message_loop.cc

Issue 448713002: Revert of Make SingleThreadProxy a SchedulerClient (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « cc/trees/layer_tree_host_unittest_context.cc ('k') | cc/trees/layer_tree_settings.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/message_loop/message_loop_proxy.h" 5 #include "base/message_loop/message_loop_proxy.h"
6 #include "base/threading/simple_thread.h" 6 #include "base/threading/simple_thread.h"
7 #include "cc/layers/delegated_frame_provider.h" 7 #include "cc/layers/delegated_frame_provider.h"
8 #include "cc/layers/delegated_frame_resource_collection.h" 8 #include "cc/layers/delegated_frame_resource_collection.h"
9 #include "cc/layers/delegated_renderer_layer.h" 9 #include "cc/layers/delegated_renderer_layer.h"
10 #include "cc/layers/layer.h" 10 #include "cc/layers/layer.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 did_initialize_output_surface_ = true; 67 did_initialize_output_surface_ = true;
68 } 68 }
69 virtual void WillCommit() OVERRIDE {} 69 virtual void WillCommit() OVERRIDE {}
70 virtual void DidCommit() OVERRIDE { did_commit_ = true; } 70 virtual void DidCommit() OVERRIDE { did_commit_ = true; }
71 virtual void DidCommitAndDrawFrame() OVERRIDE { 71 virtual void DidCommitAndDrawFrame() OVERRIDE {
72 did_commit_and_draw_frame_ = true; 72 did_commit_and_draw_frame_ = true;
73 } 73 }
74 virtual void DidCompleteSwapBuffers() OVERRIDE {} 74 virtual void DidCompleteSwapBuffers() OVERRIDE {}
75 75
76 // LayerTreeHostSingleThreadClient overrides. 76 // LayerTreeHostSingleThreadClient overrides.
77 virtual void ScheduleComposite() OVERRIDE {}
78 virtual void ScheduleAnimation() OVERRIDE {}
77 virtual void DidPostSwapBuffers() OVERRIDE {} 79 virtual void DidPostSwapBuffers() OVERRIDE {}
78 virtual void DidAbortSwapBuffers() OVERRIDE {} 80 virtual void DidAbortSwapBuffers() OVERRIDE {}
79 81
80 void RunTest() { 82 void RunTest() {
81 no_loop_thread_.Start(); 83 no_loop_thread_.Start();
82 no_loop_thread_.Join(); 84 no_loop_thread_.Join();
83 } 85 }
84 86
85 // base::DelegateSimpleThread::Delegate override. 87 // base::DelegateSimpleThread::Delegate override.
86 virtual void Run() OVERRIDE { 88 virtual void Run() OVERRIDE {
87 ASSERT_FALSE(base::MessageLoopProxy::current()); 89 ASSERT_FALSE(base::MessageLoopProxy::current());
88 RunTestWithoutMessageLoop(); 90 RunTestWithoutMessageLoop();
89 EXPECT_FALSE(base::MessageLoopProxy::current()); 91 EXPECT_FALSE(base::MessageLoopProxy::current());
90 } 92 }
91 93
92 protected: 94 protected:
93 virtual void RunTestWithoutMessageLoop() = 0; 95 virtual void RunTestWithoutMessageLoop() = 0;
94 96
95 void SetupLayerTreeHost() { 97 void SetupLayerTreeHost() {
96 LayerTreeSettings settings; 98 LayerTreeSettings settings;
97 settings.single_thread_proxy_scheduler = false;
98 layer_tree_host_ = 99 layer_tree_host_ =
99 LayerTreeHost::CreateSingleThreaded(this, this, NULL, settings, NULL); 100 LayerTreeHost::CreateSingleThreaded(this, this, NULL, settings, NULL);
100 layer_tree_host_->SetViewportSize(size_); 101 layer_tree_host_->SetViewportSize(size_);
101 layer_tree_host_->SetRootLayer(root_layer_); 102 layer_tree_host_->SetRootLayer(root_layer_);
102 } 103 }
103 104
104 void Composite() { 105 void Composite() {
105 did_commit_ = false; 106 did_commit_ = false;
106 did_commit_and_draw_frame_ = false; 107 did_commit_and_draw_frame_ = false;
107 layer_tree_host_->Composite(gfx::FrameTime::Now()); 108 layer_tree_host_->Composite(gfx::FrameTime::Now());
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 scoped_refptr<DelegatedFrameProvider> frame_provider_; 226 scoped_refptr<DelegatedFrameProvider> frame_provider_;
226 scoped_refptr<DelegatedRendererLayer> delegated_layer_; 227 scoped_refptr<DelegatedRendererLayer> delegated_layer_;
227 }; 228 };
228 229
229 TEST_F(LayerTreeHostNoMessageLoopDelegatedLayer, SingleDelegatedLayer) { 230 TEST_F(LayerTreeHostNoMessageLoopDelegatedLayer, SingleDelegatedLayer) {
230 RunTest(); 231 RunTest();
231 } 232 }
232 233
233 } // namespace 234 } // namespace
234 } // namespace cc 235 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest_context.cc ('k') | cc/trees/layer_tree_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698