summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/animation/keyframe_effect_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/blink/renderer/core/animation/keyframe_effect_test.cc')
-rw-r--r--chromium/third_party/blink/renderer/core/animation/keyframe_effect_test.cc36
1 files changed, 34 insertions, 2 deletions
diff --git a/chromium/third_party/blink/renderer/core/animation/keyframe_effect_test.cc b/chromium/third_party/blink/renderer/core/animation/keyframe_effect_test.cc
index c7d170c625a..990602e28c8 100644
--- a/chromium/third_party/blink/renderer/core/animation/keyframe_effect_test.cc
+++ b/chromium/third_party/blink/renderer/core/animation/keyframe_effect_test.cc
@@ -14,6 +14,8 @@
#include "third_party/blink/renderer/bindings/core/v8/v8_keyframe_effect_options.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_object_builder.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_optional_effect_timing.h"
+#include "third_party/blink/renderer/bindings/core/v8/v8_union_cssnumericvalue_double.h"
+#include "third_party/blink/renderer/bindings/core/v8/v8_union_keyframeeffectoptions_unrestricteddouble.h"
#include "third_party/blink/renderer/core/animation/animation.h"
#include "third_party/blink/renderer/core/animation/animation_clock.h"
#include "third_party/blink/renderer/core/animation/animation_test_helpers.h"
@@ -88,8 +90,13 @@ class AnimationKeyframeEffectV8Test : public KeyframeEffectTest {
NonThrowableExceptionState exception_state;
return KeyframeEffect::Create(
script_state, element, keyframe_object,
+#if defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION)
+ MakeGarbageCollected<V8UnionKeyframeEffectOptionsOrUnrestrictedDouble>(
+ timing_input),
+#else // defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION)
UnrestrictedDoubleOrKeyframeEffectOptions::FromUnrestrictedDouble(
timing_input),
+#endif // defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION)
exception_state);
}
static KeyframeEffect* CreateAnimationFromOption(
@@ -100,8 +107,13 @@ class AnimationKeyframeEffectV8Test : public KeyframeEffectTest {
NonThrowableExceptionState exception_state;
return KeyframeEffect::Create(
script_state, element, keyframe_object,
+#if defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION)
+ MakeGarbageCollected<V8UnionKeyframeEffectOptionsOrUnrestrictedDouble>(
+ const_cast<KeyframeEffectOptions*>(timing_input)),
+#else // defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION)
UnrestrictedDoubleOrKeyframeEffectOptions::FromKeyframeEffectOptions(
const_cast<KeyframeEffectOptions*>(timing_input)),
+#endif // defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION)
exception_state);
}
static KeyframeEffect* CreateAnimation(ScriptState* script_state,
@@ -364,8 +376,8 @@ TEST_F(AnimationKeyframeEffectV8Test, SetKeyframesAdditiveCompositeOperation) {
TEST_F(KeyframeEffectTest, TimeToEffectChange) {
Timing timing;
timing.iteration_duration = AnimationTimeDelta::FromSecondsD(100);
- timing.start_delay = 100;
- timing.end_delay = 100;
+ timing.start_delay = AnimationTimeDelta::FromSecondsD(100);
+ timing.end_delay = AnimationTimeDelta::FromSecondsD(100);
timing.fill_mode = Timing::FillMode::NONE;
auto* keyframe_effect = MakeGarbageCollected<KeyframeEffect>(
nullptr, CreateEmptyEffectModel(), timing);
@@ -378,28 +390,48 @@ TEST_F(KeyframeEffectTest, TimeToEffectChange) {
keyframe_effect->TimeToReverseEffectChange());
// End of the before phase.
+#if defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION)
+ animation->setCurrentTime(MakeGarbageCollected<V8CSSNumberish>(100000),
+ ASSERT_NO_EXCEPTION);
+#else // defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION)
animation->setCurrentTime(CSSNumberish::FromDouble(100000));
+#endif // defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION)
EXPECT_TIMEDELTA(AnimationTimeDelta::FromSecondsD(100),
keyframe_effect->TimeToForwardsEffectChange());
EXPECT_TIMEDELTA(AnimationTimeDelta(),
keyframe_effect->TimeToReverseEffectChange());
// Nearing the end of the active phase.
+#if defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION)
+ animation->setCurrentTime(MakeGarbageCollected<V8CSSNumberish>(199000),
+ ASSERT_NO_EXCEPTION);
+#else // defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION)
animation->setCurrentTime(CSSNumberish::FromDouble(199000));
+#endif // defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION)
EXPECT_TIMEDELTA(AnimationTimeDelta::FromSecondsD(1),
keyframe_effect->TimeToForwardsEffectChange());
EXPECT_TIMEDELTA(AnimationTimeDelta(),
keyframe_effect->TimeToReverseEffectChange());
// End of the active phase.
+#if defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION)
+ animation->setCurrentTime(MakeGarbageCollected<V8CSSNumberish>(200000),
+ ASSERT_NO_EXCEPTION);
+#else // defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION)
animation->setCurrentTime(CSSNumberish::FromDouble(200000));
+#endif // defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION)
EXPECT_TIMEDELTA(AnimationTimeDelta::FromSecondsD(100),
keyframe_effect->TimeToForwardsEffectChange());
EXPECT_TIMEDELTA(AnimationTimeDelta(),
keyframe_effect->TimeToReverseEffectChange());
// End of the animation.
+#if defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION)
+ animation->setCurrentTime(MakeGarbageCollected<V8CSSNumberish>(300000),
+ ASSERT_NO_EXCEPTION);
+#else // defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION)
animation->setCurrentTime(CSSNumberish::FromDouble(300000));
+#endif // defined(USE_BLINK_V8_BINDING_NEW_IDL_UNION)
EXPECT_EQ(AnimationTimeDelta::Max(),
keyframe_effect->TimeToForwardsEffectChange());
EXPECT_TIMEDELTA(AnimationTimeDelta::FromSecondsD(100),