Commit Graph

60 Commits

Author SHA1 Message Date
Hiroyuki Ikezoe
bcebd05d7e Bug 1442150 - Move startsRightNow into testcommon.js and rename it to animationStartsRightNow. r=birtles
MozReview-Commit-ID: 58umbOjy4di
2018-03-06 10:35:26 +09:00
Hiroyuki Ikezoe
809d67c907 Bug 1430654 - Double epsilon value for assert_times_equal. r=birtles
Since the function assumes that both of actual and expected values
have the same precision requirements.

MozReview-Commit-ID: 4C3TAH6mUVg
2018-01-22 14:57:57 +09:00
Hiroyuki Ikezoe
110c19431f Bug 1430654 - Introduce assert_time_equals_literal and use it. r=birtles
This assertion is supposed to be used where the first argument has a tolerance
but the second argument doesn't have such tolerance.  Whereas
assert_times_equal() is supposed to be used for the case both arguments have
the same tolerance, actually it hasn't, it will be fixed in a subsequent patch
in this patch series.

MozReview-Commit-ID: FEDHilbX2rm
2018-01-22 14:55:16 +09:00
Brian Birtles
0c6901d581 Bug 1425548 - Update references to Web Animations spec in dom/animation; r=hiro
MozReview-Commit-ID: 1f2Mz0VhnBm
2017-12-15 14:55:08 -06:00
Hiroyuki Ikezoe
b7da8ddd7d Bug 1421476 - Make waitForAnimationFrames wait for the correct number of consecutive animation frames for the given count. r=birtles
As mentioned in the previous commit, with the conformant Promise handling there
are cases where a requestAnimationFrame callback can happen in the same tick of
the refresh driver, that is, the same animation frame.  We should only count
callbacks that occur in frames subsequent to the current one.

MozReview-Commit-ID: IEC7uFwGysS
2017-11-29 13:05:07 +09:00
Hiroyuki Ikezoe
aa172e6c77 Bug 1421476 - Add waitForNextFrame() that ensures the state in the next frame. r=birtles
With the conformant Promise handling, there are cases that we are still in the
same tick even after we got a reqeustAnimationFrame.  For example, if we call
requestAnimationFrame() in the callback for an animationstart event, the
callback is processed just before the callback for requestAnimationFrame is
processed in a tick, so we are still in the same tick even after we got the
requestAnimationFrame.

MozReview-Commit-ID: Cgnu7Mk4Nl8
2017-11-29 13:04:17 +09:00
Hiroyuki Ikezoe
1a89948602 Bug 1415734 - Don't start test refresh mode if there is any suppressed paints. r=birtles
When paintingSuppressed flag is true, paint_listener.waitForPaints() defers the
waiting paint to the next tick.  The paintingSupressed flag is set when pres
shell is initialized and at that time if the document has not been loaded yet,
a timer is created to clear the flag after nglayout.initialpaint.delay
elapsed.  And when the timer is fired, the flag is cleared, but if there is
still pending reflow, it's not cleared.

So what happened in the failure case;

1) In the first promise_test we wait for document load
2) The paintingSuppressed flag is set in the first promise_test and create the
   timer
3) When the document has been loaded but the timer has not yet been fired,
   start test refresh mode and create an element in the subsequent promise_test
4) Creating the element triggers a reflow
5) waitForPaints() is called
6) The timer is fired, but there is a pending reflow, so skip clearing the flag
7) Now it's in the test refresh mode, the pending flow will never be processed
   until some triggers happen (i.e. mouse movement, calling
   advanceTimeAndRefresh, etc.)
8) The test is timed out

MozReview-Commit-ID: 5fLn9SNHp1J
2017-11-10 06:38:15 +09:00
Hiroyuki Ikezoe
2d4c8bb28a Bug 1415042 - Wait for two requestAnimationFrames to ensure that animations have been tried to send to the compositor in test_running_on_compositor.html. r=birtles
MozReview-Commit-ID: FhzRLiKiLC
2017-11-07 14:50:15 +09:00
Hiroyuki Ikezoe
72e6f60564 Bug 1379515 - Propagate testharness functions only if we use testharness.js. r=birtles
We are going to use SimpleTest.js in the sub window.

MozReview-Commit-ID: HAAMnY7xDNn
2017-10-30 09:49:29 +09:00
Boris Chiou
19805526c0 Bug 1388601 - Part 1: Add tests of distance for Basic Shape. r=hiro
MozReview-Commit-ID: 8m5km7hVNvR
2017-09-14 11:25:16 +08:00
Hiroyuki Ikezoe
02ddf5e128 Bug 1379516 - Add isStyledByServo(). r=birtles
DOMWindowUtils.isStyledByServo checks not only the preference value but also
STYLO_FORCE_ENABLED value. This is important especially when we run test on
our CI. On our CI, the preference value is false but just STYLO_FORCE_ENABLED
is set.

MozReview-Commit-ID: FKEd5LFwcxf
2017-08-11 08:43:45 +09:00
Mantaroh Yoshinaga
342cd76407 Bug 1374564 - Add drop-shadow's serialization test. r=hiro
MozReview-Commit-ID: Cf3Zhvwmklv
2017-06-30 16:28:13 -07:00
Mantaroh Yoshinaga
9a9f9ba9c6 Bug 1376513 - Fix expected value for serizalization value for text-shadow of mochitest and skip this test case on gecko. r=hiro
MozReview-Commit-ID: CTOGgCiYTeD
2017-06-27 13:47:45 -07:00
Hiroyuki Ikezoe
fc6cc78b3b Bug 1329077 - Revert the hack that opens a new window to use requestIdleCallback. r=boris
requestIdleCallback has been enable by default in bug 1314959.

MozReview-Commit-ID: 7rwqdsCdjNb
2017-05-20 20:33:26 +09:00
Brian Birtles
80335d948d Bug 1361234 - Restore test_deferred_start.html to actually testing delay; r=hiro
Once upon a time[1] a test was added to test_deferred_start.html to test the
code path where we establish the start time to pass to the compositor when
resolving a pending animation.

Later[2], however, we encountered intermittent failures on B2G so we made it
stop waiting on animation.ready and use waitForPaints instead. There were two
problems with this, however.

Firstly, waiting for paints often means that extra paints are processed such
that we end up updating the start time on the layer using a different code path
and masking any potential bugs in the code path under test.

Secondly, when we made this change we replaced:

  return animation.ready.then(function() { /* test code */ })

with:

  return waitForPaints(function() { /* test code */ })

And sadly that means that 'test code' never runs. Of course, what we meant to
write was:

  return waitForPaints().then(function() { /* test code */ })

As a result, when we later broke the code path under test no one noticed.

This patch restores the test so that it tests what it intends to (and currently
fails, at least most of the time).

[1] https://hg.mozilla.org/mozilla-central/rev/79cac8c71159
[2] https://hg.mozilla.org/mozilla-central/rev/986b18fdfdba
[3] https://hg.mozilla.org/mozilla-central/rev/b66b75c2d042101b954e6423438cc07955c2b9bd

MozReview-Commit-ID: 1iMWLQP6zae
2017-05-02 16:40:23 +09:00
Mantaroh Yoshinaga
0e41e4c469 Bug 1338069 - Don't use 'window' object when using getComputedStyle in tests. r=birtles
MozReview-Commit-ID: KWUNCIaF183
2017-04-06 12:43:47 +09:00
Brian Birtles
9ba0219ea3 Bug 1343589 - Move setupSynchronousObserver from testcommon.js to test_animation_observers_sync.html r=hiro
This function is only used in test_animation_observers_sync.html. Putting it in
another file makes test_animation_observers_sync.html harder to follow so until
we actually share it with other files we should be it in the one file.

MozReview-Commit-ID: DJXWH4wFWxZ
2017-03-28 14:51:52 +09:00
Mantaroh Yoshinaga
2133a5209e Bug 1337994 part 2 - Add restyle tests for cheking the frame is out of view. r=hiro
MozReview-Commit-ID: z2vDbyfDsi
2017-03-28 01:51:49 +09:00
Daisuke Akatsuka
43d4dd1ae5 Bug 1339332 - Part 3: Test for missing keyframes in CSS Animation. r=hiro
MozReview-Commit-ID: 85epAy0Kd0g
2017-03-08 10:07:09 +09:00
Florian Quèze
c32c931bc9 Bug 1334831 - script-generated patch to use .remove() instead of .parentNode.removeChild, r=jaws. 2017-01-30 08:10:22 +01:00
Hiroyuki Ikezoe
dec447a5a4 Bug 1328255 - Run test_animation_performance_warning.html in a new window with enabling prefs. r=birtles
window.requestIdleCallback can not be used right after enabling its pref in the
same window object. We need to open a new window after enabling the pref.
Also, setting layout.css.devPixelsPerPx in the new windows seems to make
test_session_scroll_position.html failure on Android, so in this patch
setting layout.css.devPixelsPerPx is set before opening the new window.
"general.useragent.locale" too.

This patca moves waitForIdleCallback from testcommon.js for preventing from
being used in other tests unintentionally.

MozReview-Commit-ID: Erm2BPnikvB
2017-01-07 19:18:53 +09:00
Brian Birtles
26be484f43 Bug 1301305 - Add tests for transform animations synchronized with geometric animations: r=hiro
MozReview-Commit-ID: Ay7xqfyW0N2
2016-12-05 21:56:05 -10:00
Brian Birtles
d77c98a15b Bug 1301305 - Move propertyToIDL to testcommon.js; r=hiro
We would like to use this method in the next patch.

MozReview-Commit-ID: CSdwlVInyds
2016-12-02 08:58:19 +09:00
Hiroyuki Ikezoe
af01f4dc78 Bug 1305325 - Part 15: Tests composed style for missing keyframe for properties runnning on the compositor. r=birtles
The error value, 0.01, used in this test is the same as we used in
test_animation_omta.html.

MozReview-Commit-ID: 50g3k43yAgu
2016-12-04 08:07:40 +09:00
Hiroyuki Ikezoe
09e696df61 Bug 1311196 - Part 1: Add isOMTAEnabled() in testcommon.js. r=boris
MozReview-Commit-ID: FtJTXlsTACn
2016-10-26 17:19:37 +09:00
Hiroyuki Ikezoe
c40e95aace Bug 1283754 - Part 3: Add setupSynchronousObserver to write synchronouse tests for MutaionObserver. r=boris
MozReview-Commit-ID: 1sV5QHVeEyw
2016-10-14 06:52:11 +09:00
Hiroyuki Ikezoe
9feba4a41a Bug 1166500 - Part 9: onFrame process should be called even if frameCount is 1. r=birtles 2016-05-24 12:57:43 +09:00
Mantaroh Yoshinaga
9b517ca1d8 Bug 1134163 - Part3. Modify the currentTime and startTime tests. r=birtles
I modified several tests which related animationstart event delay.

animation-starttime and animation-currenttime tests:
 - Moved the getComputedStyle tests to test/style.
 - Removed the animation.playState tests. This tests contained by playState tests of web-platform-tests.
 - Lining common function. (e.g. calculating current/start time. etc)

MozReview-Commit-ID: 9kD9ZR1KxGv
2016-05-16 15:29:09 +09:00
Hiroyuki Ikezoe
3c3dca39c4 Bug 1256503 - Part 3: Introduce addDivAndAnimate function checking animation duration is longer than 100s to avoid intermittent test failures. r=dholbert
MozReview-Commit-ID: 2zIKFNPBjoK
2016-04-01 06:03:30 +09:00
Hiroyuki Ikezoe
67ae1015c4 Bug 1256503 - Part 1: Use MS_PER_SEC instead of human-misreadable digits in animation tests. r=dholbert
MozReview-Commit-ID: CtMF84ExBLa
2016-04-01 06:03:21 +09:00
Boris Chiou
fc55223fcb Bug 1234403 - Part 3: Test for the CSSPseudoElement objects returned by effect.target. r=birtles 2016-02-24 03:12:00 +01:00
Hiroyuki Ikezoe
2221cc068d Bug 1235286 - Part 1: Add an argument to waitForAnimationFrames to run a task in each requestAnimationFrame callback. r=birtles 2016-01-08 09:49:04 +09:00
Hiroyuki Ikezoe
0697aa9911 Bug 1212720 - Part 4: Remove all cancelAllAnimationsOnEnd. It is not needed any more. r=bbirtles 2015-12-22 00:50:00 -05:00
Hiroyuki Ikezoe
c8add9d619 Bug 1212720 - Part 2: Tests for document.getAnimations. r=heycam 2016-01-06 14:22:00 -05:00
Brian Birtles
d3b67bf081 Bug 1216846 - Don't update hold time when completing a pause if it is already set; r=heycam
The Animation.pause() method operates asynchronously since, if the animation is
currently running on the compositor, we should wait for the animation to stop
on the compositor before establishing the pause time. Otherwise, if the
compositor is ahead of the main thread and we use the main thread's notion of
the current time to establish the pause time, the animation will jump backwards
when we take it off the compositor.

This pause time is represented using the "hold time".

However, when we have a finished animation, its current time is not advancing
but rather its current time is fixed to its end time. This too is represented
using the hold time. As a result, if we pause a finished animation we should
not update its hold time (by calculating the current time from the start time)
but just continue to use the existing hold time. This is true of any other
situation where we might have set the hold time before or during pausing.
2015-11-02 08:33:58 +09:00
Brian Birtles
1183ea71cd Bug 1208938 part 3 - Update pending finishing handling; r=heycam
Animation::Tick contains special handling to cope with pending ready times
that are in the future. This was originally introduced to cope with the
situation where we are called multiple times per refresh-driver tick.

As of bug 1195180, Animation::Tick should no longer be called multiple
times per refresh driver tick. It would seem, therefore, that we no longer
need to check for a future time. However, since introducing this check, the
vsync refresh driver timer has been added which means that we can still have
a recorded time from TimeStamp::Now that is ahead of the vsync time used to
update the refresh driver. In that case, however, rather than waiting for the
next tick, we should simply clamp that pending ready time to the refresh driver
time and finish pending immediately.

This patch also updates one of the tests for reversing. With this updated
behavior we can sometimes arrive at a situation where when an Animation starts
and its ready promise resolves, its currentTime is still 0. If we call
reverse() at this point on an animation with an infinite active duration it
should throw an InvalidStateError. To avoid this situation, this test makes
sure we wait an extra frame before calling reverse().
2015-10-07 14:30:28 +09:00
Hiroyuki Ikezoe
f72404251b Bug 1151694 - Part 4 - Able to use testcommon.js in the window which has no opener. r=bbirtles 2015-09-10 19:17:00 +02:00
Brian Birtles
cc74834294 Bug 1203009 part 6 - Add tests for new composite order; r=heycam 2015-09-15 13:58:17 +09:00
Hiroyuki Ikezoe
53cd224b45 Bug 1182931 - Expose assert_unreached in subwindows. r=bbirtles 2015-07-12 17:04:00 +02:00
Brian Birtles
08b54f6f2c Bug 1171817 part 14 - Add AnimationPtrComparator class; r=dbaron
Having created composite ordering methods for the different kinds of animations
this patch adds a Comparator class so that they can be used to sort an
array of such animations.

This patch uses this Comparator object to sort the results returned by
Element.getAnimations. For this case, the order in which we create animations
and transitions happens to almost perfectly correspond with the composite
ordering defined so that no sorting is necessary.

One exception is that some -moz-* transitions may be created after transitions
that they should sort before when sorting by transition property. In this
case the sorting added in this patch should ensure they are returned in the
correct sequence.

Unfortunately, we can't easily test this since the test files we have are
intended to be cross-browser (where -moz-* properties won't be supported).

Once we implement AnimationTimeline.getAnimations (bug 1150810) we'll have
a better opportunity to test this sorting. For now, the added tests in this
patch just serve as a regression test that the sorting hasn't upset the
already correct order (and an interop test in future once we move them to
web-platform-tests).
2015-06-09 11:13:54 +09:00
Brian Birtles
1b15f2809c Bug 1178186 part 2 - Add tests for CSSAnimation and CSSTransition interfaces; r=jwatt 2015-06-30 10:00:56 +09:00
Carsten "Tomcat" Book
76b5b4f700 Backed out changeset 1027311cd1bb (bug 1178186) 2015-07-07 14:21:49 +02:00
Brian Birtles
44079bfff9 Bug 1178186 part 2 - Add tests for CSSAnimation and CSSTransition interfaces; r=jwatt 2015-06-30 10:00:56 +09:00
Brian Birtles
e3945987e3 Bug 1166164 part 5 - Make play() throw when it should seek to the end of an infinite effect; r=jwatt, r=smaug 2015-05-19 14:00:48 +09:00
Boris Zbarsky
83864e6984 Bug 1159743. Stop forcing the dom.animations-api.core.enabled preference on in the test harness. r=birtles 2015-04-30 14:25:03 -04:00
Wes Kocher
143b05ecba Backed out changeset 4d85a02e9c28 (bug 1159743) under suspicion of breaking animation tests CLOSED TREE 2015-04-30 15:25:58 -07:00
Boris Zbarsky
fa14fc0c65 Bug 1159743. Stop forcing the dom.animations-api.core.enabled preference on in the test harness. r=birtles 2015-04-30 14:25:03 -04:00
Jonathan Watt
517a557168 Bug 1149832 - Replace the Web Animations test helper waitForTwoAnimationFrames() with a helper that takes a frame count. r=birtles 2015-03-31 23:27:19 +01:00
Jonathan Watt
1092ee7947 Bug 1145246, part 2 - Update Web Animations code and tests for the rename of Animatable.getAnimationPlayers() to Animatable.getAnimations(). r=birtles 2015-03-20 18:20:37 +00:00
Jonathan Watt
c3e97b3262 Bug 1073379, part 7 - Tests for the effect of setting a CSS transition's AnimationPlayer.startTime. r=birtles 2015-03-06 15:23:17 +00:00