OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 | 593 |
594 DISALLOW_COPY_AND_ASSIGN(LayerWithNullDelegateTest); | 594 DISALLOW_COPY_AND_ASSIGN(LayerWithNullDelegateTest); |
595 }; | 595 }; |
596 | 596 |
597 class FakeTexture : public Texture { | 597 class FakeTexture : public Texture { |
598 public: | 598 public: |
599 FakeTexture(bool flipped, const gfx::Size& size, float device_scale_factor) | 599 FakeTexture(bool flipped, const gfx::Size& size, float device_scale_factor) |
600 : Texture(flipped, size, device_scale_factor) {} | 600 : Texture(flipped, size, device_scale_factor) {} |
601 | 601 |
602 virtual unsigned int PrepareTexture() OVERRIDE { return 0; } | 602 virtual unsigned int PrepareTexture() OVERRIDE { return 0; } |
603 virtual WebKit::WebGraphicsContext3D* HostContext3D() OVERRIDE { | 603 virtual blink::WebGraphicsContext3D* HostContext3D() OVERRIDE { |
604 return NULL; | 604 return NULL; |
605 } | 605 } |
606 | 606 |
607 protected: | 607 protected: |
608 virtual ~FakeTexture() {} | 608 virtual ~FakeTexture() {} |
609 }; | 609 }; |
610 | 610 |
611 TEST_F(LayerWithNullDelegateTest, SwitchLayerPreservesCCLayerState) { | 611 TEST_F(LayerWithNullDelegateTest, SwitchLayerPreservesCCLayerState) { |
612 scoped_ptr<Layer> l1(CreateColorLayer(SK_ColorRED, | 612 scoped_ptr<Layer> l1(CreateColorLayer(SK_ColorRED, |
613 gfx::Rect(20, 20, 400, 400))); | 613 gfx::Rect(20, 20, 400, 400))); |
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1446 l1->SetOpacity(0.5f); | 1446 l1->SetOpacity(0.5f); |
1447 | 1447 |
1448 // Change l1's cc::Layer. | 1448 // Change l1's cc::Layer. |
1449 l1->SwitchCCLayerForTest(); | 1449 l1->SwitchCCLayerForTest(); |
1450 | 1450 |
1451 // Ensure that the opacity animation completed. | 1451 // Ensure that the opacity animation completed. |
1452 EXPECT_FLOAT_EQ(l1->opacity(), 0.5f); | 1452 EXPECT_FLOAT_EQ(l1->opacity(), 0.5f); |
1453 } | 1453 } |
1454 | 1454 |
1455 } // namespace ui | 1455 } // namespace ui |
OLD | NEW |