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

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

Issue 61823008: Introduce separate client and init path for single-threaded cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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.cc ('k') | cc/trees/layer_tree_host_unittest_scroll.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "cc/layers/content_layer.h" 8 #include "cc/layers/content_layer.h"
9 #include "cc/layers/delegated_frame_provider.h" 9 #include "cc/layers/delegated_frame_provider.h"
10 #include "cc/layers/delegated_frame_resource_collection.h" 10 #include "cc/layers/delegated_frame_resource_collection.h"
(...skipping 1761 matching lines...) Expand 10 before | Expand all | Expand 10 after
1772 1772
1773 // FakeLayerTreeHostClient implementation. 1773 // FakeLayerTreeHostClient implementation.
1774 virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback) 1774 virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback)
1775 OVERRIDE { 1775 OVERRIDE {
1776 return scoped_ptr<OutputSurface>(); 1776 return scoped_ptr<OutputSurface>();
1777 } 1777 }
1778 1778
1779 void RunTest(bool threaded, 1779 void RunTest(bool threaded,
1780 bool delegating_renderer, 1780 bool delegating_renderer,
1781 bool impl_side_painting) { 1781 bool impl_side_painting) {
1782 scoped_ptr<base::Thread> impl_thread; 1782 LayerTreeSettings settings;
1783 settings.impl_side_painting = impl_side_painting;
1783 if (threaded) { 1784 if (threaded) {
1784 impl_thread.reset(new base::Thread("LayerTreeTest")); 1785 scoped_ptr<base::Thread> impl_thread(new base::Thread("LayerTreeTest"));
1785 ASSERT_TRUE(impl_thread->Start()); 1786 ASSERT_TRUE(impl_thread->Start());
1786 ASSERT_TRUE(impl_thread->message_loop_proxy().get()); 1787 ASSERT_TRUE(impl_thread->message_loop_proxy().get());
1788 scoped_ptr<LayerTreeHost> layer_tree_host = LayerTreeHost::CreateThreaded(
1789 this, NULL, settings, impl_thread->message_loop_proxy());
1790 EXPECT_FALSE(layer_tree_host);
1791 } else {
1792 scoped_ptr<LayerTreeHost> layer_tree_host =
1793 LayerTreeHost::CreateSingleThreaded(this, this, NULL, settings);
1794 EXPECT_FALSE(layer_tree_host);
1787 } 1795 }
1788
1789 LayerTreeSettings settings;
1790 settings.impl_side_painting = impl_side_painting;
1791 scoped_ptr<LayerTreeHost> layer_tree_host = LayerTreeHost::Create(
1792 this,
1793 NULL,
1794 settings,
1795 impl_thread ? impl_thread->message_loop_proxy() : NULL);
1796 EXPECT_FALSE(layer_tree_host);
1797 } 1796 }
1798 }; 1797 };
1799 1798
1800 SINGLE_AND_MULTI_THREAD_TEST_F( 1799 SINGLE_AND_MULTI_THREAD_TEST_F(
1801 LayerTreeHostTestCannotCreateIfCannotCreateOutputSurface); 1800 LayerTreeHostTestCannotCreateIfCannotCreateOutputSurface);
1802 1801
1803 class UIResourceLostTest : public LayerTreeHostContextTest { 1802 class UIResourceLostTest : public LayerTreeHostContextTest {
1804 public: 1803 public:
1805 UIResourceLostTest() : time_step_(0) {} 1804 UIResourceLostTest() : time_step_(0) {}
1806 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { 1805 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
2291 protected: 2290 protected:
2292 FakeContentLayerClient client_; 2291 FakeContentLayerClient client_;
2293 scoped_refptr<FakeContentLayer> layer_; 2292 scoped_refptr<FakeContentLayer> layer_;
2294 int num_commits_; 2293 int num_commits_;
2295 }; 2294 };
2296 2295
2297 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestSurfaceCreateCallback); 2296 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestSurfaceCreateCallback);
2298 2297
2299 } // namespace 2298 } // namespace
2300 } // namespace cc 2299 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_scroll.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698