Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include <public/WebAnimation.h> | 7 #include "WebAnimationImpl.h" |
| 8 | 8 #include "WebFloatAnimationCurveImpl.h" |
| 9 #include <gtest/gtest.h> | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include <public/WebFloatAnimationCurve.h> | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 #include <wtf/OwnPtr.h> | |
| 12 #include <wtf/PassOwnPtr.h> | |
| 13 | 11 |
| 14 using namespace WebKit; | 12 using namespace WebKit; |
| 15 | 13 |
| 16 namespace { | 14 namespace { |
| 17 | 15 |
| 18 // Linux/Win bots failed on this test. | 16 TEST(WebAnimationTest, DefaultSettings) |
| 19 // https://bugs.webkit.org/show_bug.cgi?id=90651 | |
| 20 #if OS(WINDOWS) | |
| 21 #define MAYBE_DefaultSettings DISABLED_DefaultSettings | |
| 22 #elif OS(LINUX) | |
| 23 #define MAYBE_DefaultSettings DISABLED_DefaultSettings | |
| 24 #else | |
| 25 #define MAYBE_DefaultSettings DefaultSettings | |
| 26 #endif | |
| 27 TEST(WebAnimationTest, MAYBE_DefaultSettings) | |
| 28 { | 17 { |
| 29 OwnPtr<WebAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()) ; | 18 scoped_ptr<WebAnimationCurve> curve(new WebFloatAnimationCurveImpl()); |
| 30 OwnPtr<WebAnimation> animation = adoptPtr(WebAnimation::create(*curve, WebAn imation::TargetPropertyOpacity)); | 19 scoped_ptr<WebAnimation> animation(new WebAnimationImpl(*curve, WebAnimation ::TargetPropertyOpacity, 1)); |
| 31 | 20 |
| 32 // Ensure that the defaults are correct. | 21 // Ensure that the defaults are correct. |
| 33 EXPECT_EQ(1, animation->iterations()); | 22 EXPECT_EQ(1, animation->iterations()); |
| 34 EXPECT_EQ(0, animation->startTime()); | 23 EXPECT_EQ(0, animation->startTime()); |
| 35 EXPECT_EQ(0, animation->timeOffset()); | 24 EXPECT_EQ(0, animation->timeOffset()); |
| 36 EXPECT_FALSE(animation->alternatesDirection()); | 25 EXPECT_FALSE(animation->alternatesDirection()); |
| 37 } | 26 } |
| 38 | 27 |
| 39 // Linux/Win bots failed on this test. | 28 TEST(WebAnimationTest, ModifiedSettings) |
| 40 // https://bugs.webkit.org/show_bug.cgi?id=90651 | |
|
enne (OOO)
2012/10/16 01:17:36
Should this bug be closed?
| |
| 41 #if OS(WINDOWS) | |
| 42 #define MAYBE_ModifiedSettings DISABLED_ModifiedSettings | |
| 43 #elif OS(LINUX) | |
| 44 #define MAYBE_ModifiedSettings DISABLED_ModifiedSettings | |
| 45 #else | |
| 46 #define MAYBE_ModifiedSettings ModifiedSettings | |
| 47 #endif | |
| 48 TEST(WebAnimationTest, MAYBE_ModifiedSettings) | |
| 49 { | 29 { |
| 50 OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::crea te()); | 30 scoped_ptr<WebFloatAnimationCurve> curve(new WebFloatAnimationCurveImpl()); |
| 51 OwnPtr<WebAnimation> animation = adoptPtr(WebAnimation::create(*curve, WebAn imation::TargetPropertyOpacity)); | 31 scoped_ptr<WebAnimation> animation(new WebAnimationImpl(*curve, WebAnimation ::TargetPropertyOpacity, 1)); |
|
enne (OOO)
2012/10/16 01:17:36
Is there a reason to change the groupId here?
| |
| 52 animation->setIterations(2); | 32 animation->setIterations(2); |
| 53 animation->setStartTime(2); | 33 animation->setStartTime(2); |
| 54 animation->setTimeOffset(2); | 34 animation->setTimeOffset(2); |
| 55 animation->setAlternatesDirection(true); | 35 animation->setAlternatesDirection(true); |
| 56 | 36 |
| 57 EXPECT_EQ(2, animation->iterations()); | 37 EXPECT_EQ(2, animation->iterations()); |
| 58 EXPECT_EQ(2, animation->startTime()); | 38 EXPECT_EQ(2, animation->startTime()); |
| 59 EXPECT_EQ(2, animation->timeOffset()); | 39 EXPECT_EQ(2, animation->timeOffset()); |
| 60 EXPECT_TRUE(animation->alternatesDirection()); | 40 EXPECT_TRUE(animation->alternatesDirection()); |
| 61 } | 41 } |
| 62 | 42 |
| 63 } // namespace | 43 } // namespace |
| OLD | NEW |