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

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

Issue 8362006: Reland r107720 - Enable the new layer animation framework. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 9 years, 2 months 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
« no previous file with comments | « ui/gfx/compositor/layer_animation_element.cc ('k') | ui/gfx/compositor/layer_animation_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/compositor/layer_animation_element_unittest.cc
diff --git a/ui/gfx/compositor/layer_animation_element_unittest.cc b/ui/gfx/compositor/layer_animation_element_unittest.cc
index efbc1ca3cbfb77cc526eab157187b469a3a02bcd..483817ceddf4fc38ed71d2cb3ac68144d0a9b775 100644
--- a/ui/gfx/compositor/layer_animation_element_unittest.cc
+++ b/ui/gfx/compositor/layer_animation_element_unittest.cc
@@ -11,9 +11,9 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/transform.h"
+#include "ui/gfx/compositor/dummy_layer_animation_delegate.h"
#include "ui/gfx/compositor/layer_animation_delegate.h"
#include "ui/gfx/compositor/test_utils.h"
-#include "ui/gfx/compositor/test_layer_animation_delegate.h"
namespace ui {
@@ -22,7 +22,7 @@ namespace {
// Check that the transformation element progresses the delegate as expected and
// that the element can be reused after it completes.
TEST(LayerAnimationElementTest, TransformElement) {
- TestLayerAnimationDelegate delegate;
+ DummyLayerAnimationDelegate delegate;
Transform start_transform, target_transform, middle_transform;
start_transform.SetRotate(-90);
target_transform.SetRotate(90);
@@ -44,13 +44,17 @@ TEST(LayerAnimationElementTest, TransformElement) {
delegate.GetTransformForAnimation());
}
+ LayerAnimationElement::TargetValue target_value;
+ element->GetTargetValue(&target_value);
+ CheckApproximatelyEqual(target_transform, target_value.transform);
+
EXPECT_EQ(delta, element->duration());
}
// Check that the bounds element progresses the delegate as expected and
// that the element can be reused after it completes.
TEST(LayerAnimationElementTest, BoundsElement) {
- TestLayerAnimationDelegate delegate;
+ DummyLayerAnimationDelegate delegate;
gfx::Rect start, target, middle;
start = target = middle = gfx::Rect(0, 0, 50, 50);
start.set_x(-90);
@@ -70,13 +74,17 @@ TEST(LayerAnimationElementTest, BoundsElement) {
CheckApproximatelyEqual(target, delegate.GetBoundsForAnimation());
}
+ LayerAnimationElement::TargetValue target_value;
+ element->GetTargetValue(&target_value);
+ CheckApproximatelyEqual(target, target_value.bounds);
+
EXPECT_EQ(delta, element->duration());
}
// Check that the opacity element progresses the delegate as expected and
// that the element can be reused after it completes.
TEST(LayerAnimationElementTest, OpacityElement) {
- TestLayerAnimationDelegate delegate;
+ DummyLayerAnimationDelegate delegate;
float start = 0.0;
float middle = 0.5;
float target = 1.0;
@@ -94,6 +102,10 @@ TEST(LayerAnimationElementTest, OpacityElement) {
EXPECT_FLOAT_EQ(target, delegate.GetOpacityForAnimation());
}
+ LayerAnimationElement::TargetValue target_value;
+ element->GetTargetValue(&target_value);
+ EXPECT_FLOAT_EQ(target, target_value.opacity);
+
EXPECT_EQ(delta, element->duration());
}
@@ -109,8 +121,8 @@ TEST(LayerAnimationElementTest, PauseElement) {
scoped_ptr<LayerAnimationElement> element(
LayerAnimationElement::CreatePauseElement(properties, delta));
- TestLayerAnimationDelegate delegate;
- TestLayerAnimationDelegate copy = delegate;
+ DummyLayerAnimationDelegate delegate;
+ DummyLayerAnimationDelegate copy = delegate;
element->Progress(1.0, &delegate);
« no previous file with comments | « ui/gfx/compositor/layer_animation_element.cc ('k') | ui/gfx/compositor/layer_animation_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698