OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <map> | 5 #include <map> |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 2547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2558 #if !defined(USE_AURA) | 2558 #if !defined(USE_AURA) |
2559 // This test assumes a particular layer hierarchy that isn't valid for aura. | 2559 // This test assumes a particular layer hierarchy that isn't valid for aura. |
2560 // Ensures the RootView has a layer and its set up correctly. | 2560 // Ensures the RootView has a layer and its set up correctly. |
2561 TEST_F(ViewLayerTest, RootState) { | 2561 TEST_F(ViewLayerTest, RootState) { |
2562 ui::Layer* layer = widget()->GetRootView()->layer(); | 2562 ui::Layer* layer = widget()->GetRootView()->layer(); |
2563 ASSERT_TRUE(layer); | 2563 ASSERT_TRUE(layer); |
2564 EXPECT_FALSE(layer->parent()); | 2564 EXPECT_FALSE(layer->parent()); |
2565 EXPECT_EQ(0u, layer->children().size()); | 2565 EXPECT_EQ(0u, layer->children().size()); |
2566 EXPECT_FALSE(layer->transform().HasChange()); | 2566 EXPECT_FALSE(layer->transform().HasChange()); |
2567 EXPECT_EQ(widget()->GetRootView()->bounds(), layer->bounds()); | 2567 EXPECT_EQ(widget()->GetRootView()->bounds(), layer->bounds()); |
2568 EXPECT_TRUE(layer->compositor() != NULL); | 2568 EXPECT_TRUE(layer->GetCompositor() != NULL); |
2569 } | 2569 } |
2570 | 2570 |
2571 // Verifies that the complete bounds of a texture are updated if the texture | 2571 // Verifies that the complete bounds of a texture are updated if the texture |
2572 // needs to be refreshed and paint with a clip is invoked. | 2572 // needs to be refreshed and paint with a clip is invoked. |
2573 // This test invokes OnNativeWidgetPaintAccelerated, which is not used by aura. | 2573 // This test invokes OnNativeWidgetPaintAccelerated, which is not used by aura. |
2574 TEST_F(ViewLayerTest, PaintAll) { | 2574 TEST_F(ViewLayerTest, PaintAll) { |
2575 View* view = widget()->GetRootView(); | 2575 View* view = widget()->GetRootView(); |
2576 ui::Layer* layer = GetRootLayer(); | 2576 ui::Layer* layer = GetRootLayer(); |
2577 view->SetBounds(0, 0, 200, 200); | 2577 view->SetBounds(0, 0, 200, 200); |
2578 widget()->OnNativeWidgetPaintAccelerated(gfx::Rect(0, 0, 1, 1)); | 2578 widget()->OnNativeWidgetPaintAccelerated(gfx::Rect(0, 0, 1, 1)); |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3107 ScrambleTree(content); | 3107 ScrambleTree(content); |
3108 EXPECT_TRUE(ViewAndLayerTreeAreConsistent(content, content->layer())); | 3108 EXPECT_TRUE(ViewAndLayerTreeAreConsistent(content, content->layer())); |
3109 | 3109 |
3110 ScrambleTree(content); | 3110 ScrambleTree(content); |
3111 EXPECT_TRUE(ViewAndLayerTreeAreConsistent(content, content->layer())); | 3111 EXPECT_TRUE(ViewAndLayerTreeAreConsistent(content, content->layer())); |
3112 } | 3112 } |
3113 | 3113 |
3114 #endif // VIEWS_COMPOSITOR | 3114 #endif // VIEWS_COMPOSITOR |
3115 | 3115 |
3116 } // namespace views | 3116 } // namespace views |
OLD | NEW |