| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "config.h" | |
| 6 | |
| 7 #include <public/WebAnimation.h> | |
| 8 | |
| 9 #include <gtest/gtest.h> | |
| 10 #include <public/WebFloatAnimationCurve.h> | |
| 11 #include <wtf/OwnPtr.h> | |
| 12 #include <wtf/PassOwnPtr.h> | |
| 13 | |
| 14 using namespace WebKit; | |
| 15 | |
| 16 namespace { | |
| 17 | |
| 18 // Linux/Win bots failed on this test. | |
| 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 { | |
| 29 OwnPtr<WebAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create())
; | |
| 30 OwnPtr<WebAnimation> animation = adoptPtr(WebAnimation::create(*curve, WebAn
imation::TargetPropertyOpacity)); | |
| 31 | |
| 32 // Ensure that the defaults are correct. | |
| 33 EXPECT_EQ(1, animation->iterations()); | |
| 34 EXPECT_EQ(0, animation->startTime()); | |
| 35 EXPECT_EQ(0, animation->timeOffset()); | |
| 36 EXPECT_FALSE(animation->alternatesDirection()); | |
| 37 } | |
| 38 | |
| 39 // Linux/Win bots failed on this test. | |
| 40 // https://bugs.webkit.org/show_bug.cgi?id=90651 | |
| 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 { | |
| 50 OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::crea
te()); | |
| 51 OwnPtr<WebAnimation> animation = adoptPtr(WebAnimation::create(*curve, WebAn
imation::TargetPropertyOpacity)); | |
| 52 animation->setIterations(2); | |
| 53 animation->setStartTime(2); | |
| 54 animation->setTimeOffset(2); | |
| 55 animation->setAlternatesDirection(true); | |
| 56 | |
| 57 EXPECT_EQ(2, animation->iterations()); | |
| 58 EXPECT_EQ(2, animation->startTime()); | |
| 59 EXPECT_EQ(2, animation->timeOffset()); | |
| 60 EXPECT_TRUE(animation->alternatesDirection()); | |
| 61 } | |
| 62 | |
| 63 } // namespace | |
| OLD | NEW |