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

Unified Diff: ui/gfx/compositor/layer_unittest.cc

Issue 8510076: Fix stale compositor references from ui::Layer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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/gfx/compositor/layer_unittest.cc
diff --git a/ui/gfx/compositor/layer_unittest.cc b/ui/gfx/compositor/layer_unittest.cc
index 7445256c199f3696227ee0e16b7e31ed0e055ada..7f46fb11bb2334fdeb996873b690f2bcd912dd2a 100644
--- a/ui/gfx/compositor/layer_unittest.cc
+++ b/ui/gfx/compositor/layer_unittest.cc
@@ -29,8 +29,8 @@ namespace {
class ColoredLayer : public Layer, public LayerDelegate {
public:
- ColoredLayer(Compositor* compositor, SkColor color)
- : Layer(compositor, Layer::LAYER_HAS_TEXTURE),
+ ColoredLayer(SkColor color)
sky 2011/11/15 04:57:04 explicit
piman 2011/11/15 22:06:33 Done.
+ : Layer(Layer::LAYER_HAS_TEXTURE),
color_(color) {
set_delegate(this);
}
@@ -66,11 +66,11 @@ class LayerWithRealCompositorTest : public testing::Test {
}
Layer* CreateLayer(Layer::LayerType type) {
- return new Layer(GetCompositor(), type);
+ return new Layer(type);
}
Layer* CreateColorLayer(SkColor color, const gfx::Rect& bounds) {
- Layer* layer = new ColoredLayer(GetCompositor(), color);
+ Layer* layer = new ColoredLayer(color);
layer->SetBounds(bounds);
return layer;
}
@@ -238,11 +238,11 @@ class LayerWithDelegateTest : public testing::Test, public CompositorDelegate {
Compositor* compositor() { return compositor_.get(); }
virtual Layer* CreateLayer(Layer::LayerType type) {
- return new Layer(compositor(), type);
+ return new Layer(type);
}
Layer* CreateColorLayer(SkColor color, const gfx::Rect& bounds) {
- Layer* layer = new ColoredLayer(compositor(), color);
+ Layer* layer = new ColoredLayer(color);
layer->SetBounds(bounds);
return layer;
}
@@ -442,7 +442,7 @@ class LayerWithNullDelegateTest : public LayerWithDelegateTest {
}
Layer* CreateLayer(Layer::LayerType type) OVERRIDE {
- Layer* layer = new Layer(compositor(), type);
+ Layer* layer = new Layer(type);
layer->set_delegate(default_layer_delegate_.get());
return layer;
}
@@ -693,9 +693,9 @@ TEST_F(LayerWithNullDelegateTest,
// Various visibile/drawn assertions.
TEST_F(LayerWithNullDelegateTest, Visibility) {
- scoped_ptr<Layer> l1(new Layer(NULL, Layer::LAYER_HAS_TEXTURE));
- scoped_ptr<Layer> l2(new Layer(NULL, Layer::LAYER_HAS_TEXTURE));
- scoped_ptr<Layer> l3(new Layer(NULL, Layer::LAYER_HAS_TEXTURE));
+ scoped_ptr<Layer> l1(new Layer(Layer::LAYER_HAS_TEXTURE));
+ scoped_ptr<Layer> l2(new Layer(Layer::LAYER_HAS_TEXTURE));
+ scoped_ptr<Layer> l3(new Layer(Layer::LAYER_HAS_TEXTURE));
l1->Add(l2.get());
l2->Add(l3.get());
« ui/gfx/compositor/layer.cc ('K') | « ui/gfx/compositor/layer.cc ('k') | views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698