Chromium Code Reviews| Index: ui/compositor/layer_unittest.cc |
| diff --git a/ui/compositor/layer_unittest.cc b/ui/compositor/layer_unittest.cc |
| index 4c838a30188ab9676f71d1726e7e809618ebb118..8d5eeb2af0504e4de3392d57657fd0e8ad6e10ac 100644 |
| --- a/ui/compositor/layer_unittest.cc |
| +++ b/ui/compositor/layer_unittest.cc |
| @@ -642,17 +642,6 @@ class LayerWithNullDelegateTest : public LayerWithDelegateTest { |
| DISALLOW_COPY_AND_ASSIGN(LayerWithNullDelegateTest); |
| }; |
| -class FakeTexture : public Texture { |
| - public: |
| - FakeTexture(bool flipped, const gfx::Size& size, float device_scale_factor) |
| - : Texture(flipped, size, device_scale_factor) {} |
| - |
| - virtual unsigned int PrepareTexture() OVERRIDE { return 0; } |
| - |
| - protected: |
| - virtual ~FakeTexture() {} |
| -}; |
| - |
| TEST_F(LayerWithNullDelegateTest, EscapedDebugNames) { |
| scoped_ptr<Layer> layer(CreateLayer(LAYER_NOT_DRAWN)); |
| std::string name = "\"\'\\/\b\f\n\r\t\n"; |
| @@ -673,6 +662,8 @@ TEST_F(LayerWithNullDelegateTest, EscapedDebugNames) { |
| EXPECT_EQ(name, roundtrip); |
| } |
| +void ReturnMailbox(uint32 sync_point, bool is_lost) {} |
|
danakj
2014/04/08 16:08:01
We should make sure this gets called in tests in t
piman
2014/04/08 23:17:46
Done.
|
| + |
| TEST_F(LayerWithNullDelegateTest, SwitchLayerPreservesCCLayerState) { |
| scoped_ptr<Layer> l1(CreateColorLayer(SK_ColorRED, |
| gfx::Rect(20, 20, 400, 400))); |
| @@ -689,9 +680,11 @@ TEST_F(LayerWithNullDelegateTest, SwitchLayerPreservesCCLayerState) { |
| cc::Layer* before_layer = l1->cc_layer(); |
| - scoped_refptr<Texture> texture = |
| - new FakeTexture(false, gfx::Size(10, 10), 1.f); |
| - l1->SetExternalTexture(texture.get()); |
| + cc::TextureMailbox mailbox(gpu::Mailbox::Generate(), 0, 0); |
| + l1->SetTextureMailbox( |
| + mailbox, |
| + cc::SingleReleaseCallback::Create(base::Bind(ReturnMailbox)), |
| + gfx::Size(1, 1)); |
| EXPECT_NE(before_layer, l1->cc_layer()); |