OLD | NEW |
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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "CCLayerTreeHost.h" | 7 #include "CCLayerTreeHost.h" |
8 #include "CCThreadedTest.h" | 8 #include "CCThreadedTest.h" |
9 #include "cc/heads_up_display_layer.h" | 9 #include "cc/heads_up_display_layer.h" |
10 #include "cc/layer.h" | 10 #include "cc/layer.h" |
11 | 11 |
12 using namespace cc; | 12 using namespace cc; |
13 using namespace WebKitTests; | 13 using namespace WebKitTests; |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 class CCHeadsUpDisplayTest : public CCThreadedTest { | 17 class HeadsUpDisplayTest : public ThreadedTest { |
18 protected: | 18 protected: |
19 virtual void initializeSettings(CCLayerTreeSettings& settings) OVERRIDE | 19 virtual void initializeSettings(LayerTreeSettings& settings) OVERRIDE |
20 { | 20 { |
21 // Enable the HUD without requiring text. | 21 // Enable the HUD without requiring text. |
22 settings.showPropertyChangedRects = true; | 22 settings.showPropertyChangedRects = true; |
23 } | 23 } |
24 }; | 24 }; |
25 | 25 |
26 class DrawsContentLayerChromium : public LayerChromium { | 26 class DrawsContentLayer : public Layer { |
27 public: | 27 public: |
28 static scoped_refptr<DrawsContentLayerChromium> create() { return make_scope
d_refptr(new DrawsContentLayerChromium()); } | 28 static scoped_refptr<DrawsContentLayer> create() { return make_scoped_refptr
(new DrawsContentLayer()); } |
29 virtual bool drawsContent() const OVERRIDE { return true; } | 29 virtual bool drawsContent() const OVERRIDE { return true; } |
30 | 30 |
31 private: | 31 private: |
32 DrawsContentLayerChromium() : LayerChromium() { } | 32 DrawsContentLayer() : Layer() { } |
33 virtual ~DrawsContentLayerChromium() | 33 virtual ~DrawsContentLayer() |
34 { | 34 { |
35 } | 35 } |
36 }; | 36 }; |
37 | 37 |
38 class CCHudWithRootLayerChange : public CCHeadsUpDisplayTest { | 38 class HudWithRootLayerChange : public HeadsUpDisplayTest { |
39 public: | 39 public: |
40 CCHudWithRootLayerChange() | 40 HudWithRootLayerChange() |
41 : m_rootLayer1(DrawsContentLayerChromium::create()) | 41 : m_rootLayer1(DrawsContentLayer::create()) |
42 , m_rootLayer2(DrawsContentLayerChromium::create()) | 42 , m_rootLayer2(DrawsContentLayer::create()) |
43 , m_numCommits(0) | 43 , m_numCommits(0) |
44 { | 44 { |
45 } | 45 } |
46 | 46 |
47 virtual void beginTest() OVERRIDE | 47 virtual void beginTest() OVERRIDE |
48 { | 48 { |
49 m_rootLayer1->setBounds(IntSize(30, 30)); | 49 m_rootLayer1->setBounds(IntSize(30, 30)); |
50 m_rootLayer2->setBounds(IntSize(30, 30)); | 50 m_rootLayer2->setBounds(IntSize(30, 30)); |
51 | 51 |
52 postSetNeedsCommitToMainThread(); | 52 postSetNeedsCommitToMainThread(); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 endTest(); | 93 endTest(); |
94 break; | 94 break; |
95 } | 95 } |
96 } | 96 } |
97 | 97 |
98 virtual void afterTest() OVERRIDE | 98 virtual void afterTest() OVERRIDE |
99 { | 99 { |
100 } | 100 } |
101 | 101 |
102 private: | 102 private: |
103 scoped_refptr<DrawsContentLayerChromium> m_rootLayer1; | 103 scoped_refptr<DrawsContentLayer> m_rootLayer1; |
104 scoped_refptr<DrawsContentLayerChromium> m_rootLayer2; | 104 scoped_refptr<DrawsContentLayer> m_rootLayer2; |
105 int m_numCommits; | 105 int m_numCommits; |
106 }; | 106 }; |
107 | 107 |
108 TEST_F(CCHudWithRootLayerChange, runMultiThread) | 108 TEST_F(HudWithRootLayerChange, runMultiThread) |
109 { | 109 { |
110 runTest(true); | 110 runTest(true); |
111 } | 111 } |
112 | 112 |
113 } // namespace | 113 } // namespace |
OLD | NEW |