summaryrefslogtreecommitdiffstats
path: root/ui/views/view_unittest.cc
diff options
context:
space:
mode:
authorpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-28 03:23:01 +0000
committerpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-28 03:23:01 +0000
commitf83c6f7f3c90cd3bebaa961737ba80db27240c1f (patch)
treea3f88a052afb0c729bc087cd0a7fcb539a53df7c /ui/views/view_unittest.cc
parent33755436093b6bb4de670227245f31043c28f85e (diff)
downloadchromium_src-f83c6f7f3c90cd3bebaa961737ba80db27240c1f.zip
chromium_src-f83c6f7f3c90cd3bebaa961737ba80db27240c1f.tar.gz
chromium_src-f83c6f7f3c90cd3bebaa961737ba80db27240c1f.tar.bz2
Fold views_compositor=1 into use_aura=1
We don't have a use case for views_compositor=1 and use_aura=0 (and it's broken/untested anyway), so this simplifies things a little bit. BUG=None TEST=compiles, tests pass. Review URL: http://codereview.chromium.org/9225038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119583 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/view_unittest.cc')
-rw-r--r--ui/views/view_unittest.cc42
1 files changed, 2 insertions, 40 deletions
diff --git a/ui/views/view_unittest.cc b/ui/views/view_unittest.cc
index ea383bc..9e55992 100644
--- a/ui/views/view_unittest.cc
+++ b/ui/views/view_unittest.cc
@@ -2536,7 +2536,7 @@ TEST_F(ViewTest, AddExistingChild) {
// Layers
////////////////////////////////////////////////////////////////////////////////
-#if defined(VIEWS_COMPOSITOR)
+#if defined(USE_AURA)
namespace {
@@ -2575,14 +2575,10 @@ class ViewLayerTest : public ViewsTestBase {
// Returns the Layer used by the RootView.
ui::Layer* GetRootLayer() {
-#if defined(USE_AURA)
ui::Layer* root_layer = NULL;
gfx::Point origin;
widget()->CalculateOffsetToAncestorWithLayer(&origin, &root_layer);
return root_layer;
-#else
- return widget()->GetRootView()->layer();
-#endif
}
virtual void SetUp() OVERRIDE {
@@ -2612,45 +2608,13 @@ class ViewLayerTest : public ViewsTestBase {
bool old_use_acceleration_;
};
-#if !defined(USE_AURA)
-// This test assumes a particular layer hierarchy that isn't valid for aura.
-// Ensures the RootView has a layer and its set up correctly.
-TEST_F(ViewLayerTest, RootState) {
- ui::Layer* layer = widget()->GetRootView()->layer();
- ASSERT_TRUE(layer);
- EXPECT_FALSE(layer->parent());
- EXPECT_EQ(0u, layer->children().size());
- EXPECT_FALSE(layer->transform().HasChange());
- EXPECT_EQ(widget()->GetRootView()->bounds(), layer->bounds());
- EXPECT_TRUE(layer->GetCompositor() != NULL);
-}
-
-// Verifies that the complete bounds of a texture are updated if the texture
-// needs to be refreshed and paint with a clip is invoked.
-// This test invokes OnNativeWidgetPaintAccelerated, which is not used by aura.
-TEST_F(ViewLayerTest, PaintAll) {
- View* view = widget()->GetRootView();
- ui::Layer* layer = GetRootLayer();
- view->SetBounds(0, 0, 200, 200);
- widget()->OnNativeWidgetPaintAccelerated(gfx::Rect(0, 0, 1, 1));
- ASSERT_TRUE(layer != NULL);
- const ui::TestTexture* texture =
- static_cast<const ui::TestTexture*>(layer->texture());
- ASSERT_TRUE(texture != NULL);
- EXPECT_EQ(view->GetLocalBounds(), texture->bounds_of_last_paint());
-}
-#endif
TEST_F(ViewLayerTest, LayerToggling) {
// Because we lazily create textures the calls to DrawTree are necessary to
// ensure we trigger creation of textures.
-#if defined(USE_AURA)
ui::Layer* root_layer = NULL;
gfx::Point origin;
widget()->CalculateOffsetToAncestorWithLayer(&origin, &root_layer);
-#else
- ui::Layer* root_layer = widget()->GetRootView()->layer();
-#endif
View* content_view = new View;
widget()->SetContentsView(content_view);
@@ -2982,7 +2946,6 @@ TEST_F(ViewLayerTest, FLAKY_ViewLayerTreesInSync) {
EXPECT_TRUE(ViewAndLayerTreeAreConsistent(content, content->layer()));
}
-#if defined(USE_AURA)
// Verifies when views are reordered the layer is also reordered. The widget is
// providing the parent layer.
TEST_F(ViewLayerTest, ReorderUnderWidget) {
@@ -3006,8 +2969,7 @@ TEST_F(ViewLayerTest, ReorderUnderWidget) {
EXPECT_EQ(c1->layer(), parent_layer->children()[1]);
EXPECT_EQ(c2->layer(), parent_layer->children()[0]);
}
-#endif
-#endif // VIEWS_COMPOSITOR
+#endif // USE_AURA
} // namespace views