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

Side by Side Diff: cc/heads_up_display_unittest.cc

Issue 12774006: cc: Chromify Layer and LayerImpl classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: MoreAndroidCompilings Created 7 years, 9 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/heads_up_display_layer_impl.cc ('k') | cc/image_layer.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 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/heads_up_display_layer.h" 5 #include "cc/heads_up_display_layer.h"
6 #include "cc/layer.h" 6 #include "cc/layer.h"
7 #include "cc/layer_tree_host.h" 7 #include "cc/layer_tree_host.h"
8 #include "cc/test/layer_tree_test_common.h" 8 #include "cc/test/layer_tree_test_common.h"
9 9
10 namespace cc { 10 namespace cc {
11 namespace { 11 namespace {
12 12
13 class HeadsUpDisplayTest : public ThreadedTest { 13 class HeadsUpDisplayTest : public ThreadedTest {
14 protected: 14 protected:
15 virtual void initializeSettings(LayerTreeSettings& settings) OVERRIDE 15 virtual void initializeSettings(LayerTreeSettings& settings) OVERRIDE
16 { 16 {
17 // Enable the HUD without requiring text. 17 // Enable the HUD without requiring text.
18 settings.initialDebugState.showPropertyChangedRects = true; 18 settings.initialDebugState.showPropertyChangedRects = true;
19 } 19 }
20 }; 20 };
21 21
22 class DrawsContentLayer : public Layer { 22 class DrawsContentLayer : public Layer {
23 public: 23 public:
24 static scoped_refptr<DrawsContentLayer> create() { return make_scoped_refptr (new DrawsContentLayer()); } 24 static scoped_refptr<DrawsContentLayer> Create() { return make_scoped_refptr (new DrawsContentLayer()); }
25 virtual bool drawsContent() const OVERRIDE { return true; } 25 virtual bool DrawsContent() const OVERRIDE { return true; }
26 26
27 private: 27 private:
28 DrawsContentLayer() : Layer() { } 28 DrawsContentLayer() : Layer() { }
29 virtual ~DrawsContentLayer() 29 virtual ~DrawsContentLayer()
30 { 30 {
31 } 31 }
32 }; 32 };
33 33
34 class HudWithRootLayerChange : public HeadsUpDisplayTest { 34 class HudWithRootLayerChange : public HeadsUpDisplayTest {
35 public: 35 public:
36 HudWithRootLayerChange() 36 HudWithRootLayerChange()
37 : m_rootLayer1(DrawsContentLayer::create()) 37 : m_rootLayer1(DrawsContentLayer::Create())
38 , m_rootLayer2(DrawsContentLayer::create()) 38 , m_rootLayer2(DrawsContentLayer::Create())
39 , m_numCommits(0) 39 , m_numCommits(0)
40 { 40 {
41 } 41 }
42 42
43 virtual void beginTest() OVERRIDE 43 virtual void beginTest() OVERRIDE
44 { 44 {
45 m_rootLayer1->setBounds(gfx::Size(30, 30)); 45 m_rootLayer1->SetBounds(gfx::Size(30, 30));
46 m_rootLayer2->setBounds(gfx::Size(30, 30)); 46 m_rootLayer2->SetBounds(gfx::Size(30, 30));
47 47
48 postSetNeedsCommitToMainThread(); 48 postSetNeedsCommitToMainThread();
49 } 49 }
50 50
51 virtual void didCommit() OVERRIDE 51 virtual void didCommit() OVERRIDE
52 { 52 {
53 ++m_numCommits; 53 ++m_numCommits;
54 54
55 ASSERT_TRUE(m_layerTreeHost->hudLayer()); 55 ASSERT_TRUE(m_layerTreeHost->hudLayer());
56 56
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 int m_numCommits; 101 int m_numCommits;
102 }; 102 };
103 103
104 TEST_F(HudWithRootLayerChange, runMultiThread) 104 TEST_F(HudWithRootLayerChange, runMultiThread)
105 { 105 {
106 runTest(true); 106 runTest(true);
107 } 107 }
108 108
109 } // namespace 109 } // namespace
110 } // namespace cc 110 } // namespace cc
OLDNEW
« no previous file with comments | « cc/heads_up_display_layer_impl.cc ('k') | cc/image_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698