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

Side by Side Diff: sky/viewer/cc/web_animation_unittest.cc

Issue 752683002: Break Sky's dependency on cc (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « sky/viewer/cc/web_animation_impl.cc ('k') | sky/viewer/cc/web_blend_mode.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/memory/scoped_ptr.h"
6 #include "sky/viewer/cc/web_animation_impl.h"
7 #include "sky/viewer/cc/web_float_animation_curve_impl.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9
10 using blink::WebCompositorAnimation;
11 using blink::WebCompositorAnimationCurve;
12 using blink::WebFloatAnimationCurve;
13
14 namespace sky_viewer_cc {
15 namespace {
16
17 TEST(WebCompositorAnimationTest, DefaultSettings) {
18 scoped_ptr<WebCompositorAnimationCurve> curve(
19 new WebFloatAnimationCurveImpl());
20 scoped_ptr<WebCompositorAnimation> animation(new WebCompositorAnimationImpl(
21 *curve, WebCompositorAnimation::TargetPropertyOpacity, 1, 0));
22
23 // Ensure that the defaults are correct.
24 EXPECT_EQ(1, animation->iterations());
25 EXPECT_EQ(0, animation->startTime());
26 EXPECT_EQ(0, animation->timeOffset());
27 #if WEB_ANIMATION_SUPPORTS_FULL_DIRECTION
28 EXPECT_EQ(WebCompositorAnimation::DirectionNormal, animation->direction());
29 #else
30 EXPECT_FALSE(animation->alternatesDirection());
31 #endif
32 }
33
34 TEST(WebCompositorAnimationTest, ModifiedSettings) {
35 scoped_ptr<WebFloatAnimationCurve> curve(new WebFloatAnimationCurveImpl());
36 scoped_ptr<WebCompositorAnimation> animation(new WebCompositorAnimationImpl(
37 *curve, WebCompositorAnimation::TargetPropertyOpacity, 1, 0));
38 animation->setIterations(2);
39 animation->setStartTime(2);
40 animation->setTimeOffset(2);
41 #if WEB_ANIMATION_SUPPORTS_FULL_DIRECTION
42 animation->setDirection(WebCompositorAnimation::DirectionReverse);
43 #else
44 animation->setAlternatesDirection(true);
45 #endif
46
47 EXPECT_EQ(2, animation->iterations());
48 EXPECT_EQ(2, animation->startTime());
49 EXPECT_EQ(2, animation->timeOffset());
50 #if WEB_ANIMATION_SUPPORTS_FULL_DIRECTION
51 EXPECT_EQ(WebCompositorAnimation::DirectionReverse, animation->direction());
52 #else
53 EXPECT_TRUE(animation->alternatesDirection());
54 animation->setAlternatesDirection(false);
55 EXPECT_FALSE(animation->alternatesDirection());
56 #endif
57 }
58
59 } // namespace
60 } // namespace sky_viewer_cc
OLDNEW
« no previous file with comments | « sky/viewer/cc/web_animation_impl.cc ('k') | sky/viewer/cc/web_blend_mode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698