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

Unified Diff: ui/views/view_unittest.cc

Issue 8805033: Makes tests either use mock compositor or mock WebGraphicsContext3D (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tweaks Created 9 years 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/view_unittest.cc
diff --git a/ui/views/view_unittest.cc b/ui/views/view_unittest.cc
index 224b5c9c95084b7378f8d52e33fb01d17d0ddc7f..f1bbec75d71ea5b4e4154a4c824a6e82d92b5cde 100644
--- a/ui/views/view_unittest.cc
+++ b/ui/views/view_unittest.cc
@@ -17,8 +17,6 @@
#include "ui/gfx/compositor/compositor.h"
#include "ui/gfx/compositor/layer.h"
#include "ui/gfx/compositor/layer_animator.h"
-#include "ui/gfx/compositor/test/test_compositor.h"
-#include "ui/gfx/compositor/test/test_texture.h"
#include "ui/gfx/path.h"
#include "ui/gfx/transform.h"
#include "ui/views/background.h"
@@ -2531,8 +2529,6 @@ class ViewLayerTest : public ViewsTestBase {
old_use_acceleration_ = View::get_use_acceleration_when_possible();
View::set_use_acceleration_when_possible(true);
- ui::TestTexture::reset_live_count();
-
widget_ = new Widget;
Widget::InitParams params(Widget::InitParams::TYPE_POPUP);
params.bounds = gfx::Rect(50, 50, 200, 200);
@@ -2597,28 +2593,12 @@ TEST_F(ViewLayerTest, LayerToggling) {
View* content_view = new View;
widget()->SetContentsView(content_view);
-#if !defined(USE_WEBKIT_COMPOSITOR)
- // TODO(piman): with the webkit compositor, we don't create Textures on
- // Layers. We're not supposed to be calling Layer::DrawTree. This test needs
- // refactoring to fully work in that case.
- root_layer->DrawTree();
- ui::TestTexture::reset_live_count();
-#endif
-
// Create v1, give it a bounds and verify everything is set up correctly.
View* v1 = new View;
v1->SetPaintToLayer(true);
-#if !defined(USE_WEBKIT_COMPOSITOR)
- root_layer->DrawTree();
- EXPECT_EQ(0, ui::TestTexture::live_count());
-#endif
EXPECT_TRUE(v1->layer() != NULL);
v1->SetBounds(20, 30, 140, 150);
content_view->AddChildView(v1);
-#if !defined(USE_WEBKIT_COMPOSITOR)
- root_layer->DrawTree();
- EXPECT_EQ(1, ui::TestTexture::live_count());
-#endif
ASSERT_TRUE(v1->layer() != NULL);
EXPECT_EQ(root_layer, v1->layer()->parent());
EXPECT_EQ(gfx::Rect(20, 30, 140, 150), v1->layer()->bounds());
@@ -2629,10 +2609,6 @@ TEST_F(ViewLayerTest, LayerToggling) {
EXPECT_TRUE(v2->layer() == NULL);
v2->SetBounds(10, 20, 30, 40);
v2->SetPaintToLayer(true);
-#if !defined(USE_WEBKIT_COMPOSITOR)
- root_layer->DrawTree();
- EXPECT_EQ(2, ui::TestTexture::live_count());
-#endif
ASSERT_TRUE(v2->layer() != NULL);
EXPECT_EQ(v1->layer(), v2->layer()->parent());
EXPECT_EQ(gfx::Rect(10, 20, 30, 40), v2->layer()->bounds());
@@ -2640,10 +2616,6 @@ TEST_F(ViewLayerTest, LayerToggling) {
// Turn off v1s layer. v2 should still have a layer but its parent should have
// changed.
v1->SetPaintToLayer(false);
-#if !defined(USE_WEBKIT_COMPOSITOR)
- root_layer->DrawTree();
- EXPECT_EQ(1, ui::TestTexture::live_count());
-#endif
EXPECT_TRUE(v1->layer() == NULL);
EXPECT_TRUE(v2->layer() != NULL);
EXPECT_EQ(root_layer, v2->layer()->parent());
@@ -2657,10 +2629,6 @@ TEST_F(ViewLayerTest, LayerToggling) {
ui::Transform transform;
transform.SetScale(2.0f, 2.0f);
v1->SetTransform(transform);
-#if !defined(USE_WEBKIT_COMPOSITOR)
- root_layer->DrawTree();
- EXPECT_EQ(2, ui::TestTexture::live_count());
-#endif
EXPECT_TRUE(v1->layer() != NULL);
EXPECT_TRUE(v2->layer() != NULL);
EXPECT_EQ(root_layer, v1->layer()->parent());

Powered by Google App Engine
This is Rietveld 408576698