Commit Graph

88 Commits

Author SHA1 Message Date
Brian Birtles
c165920840 Bug 1436659 - Add tests for Animation.updatePlaybackRate; r=hiro
These tests test the behavior introduced in the following changesets to the Web
Animations specification:

  1. 5af5e276ba
  2. 673f6fc126

which can be viewed as a merged diff at:

  https://gist.github.com/birtles/d147eb2e0e2d4d37fadf217abd709411

See the following spec issues:

  1. https://github.com/w3c/csswg-drafts/issues/2059
  2. https://github.com/w3c/csswg-drafts/issues/2266

MozReview-Commit-ID: 3XJHXIlgSwF
2018-02-13 15:04:18 +09:00
Brian Birtles
094902f08d Bug 1436659 - Further divide up finishing tests; r=hiro
MozReview-Commit-ID: FmYwTauidbv
2018-02-13 15:04:17 +09:00
Brian Birtles
f57a225d98 Bug 1436659 - Tidy up tests for "finishing an animation"; r=hiro
These patches update these tests as follows:

* Used async/await where it simplifies the tests
* Updated the test descriptions to reflect what they are testing in the timing
  model
* Fixed a couple of bugs where we set the playbackRate on a pause-pending
  animation (which causes it to no longer be pause-pending).

In the process I noticed a couple of tests that don't really belong here. They
will be moved in the next patch.

MozReview-Commit-ID: C33o7qLNMMd
2018-02-13 15:04:15 +09:00
Brian Birtles
5fc78644da Bug 1436659 - Move finishing tests to timing-model; r=hiro
These tests are not testing the interface so much as the 'finish an animation'
procedure.

This patch simply moves the tests as-is. They will be simplified in the next
patch in this series.

MozReview-Commit-ID: 5nloB5GtxHv
2018-02-13 15:04:14 +09:00
Brian Birtles
20b437ba3b Bug 1436659 - Simplify playback rate setting test; r=hiro
I didn't like the way these tests were written so I decided to rewrite them to
make it more clear what they are trying to test.

MozReview-Commit-ID: IBqMUh24crS
2018-02-13 15:04:12 +09:00
Brian Birtles
da7fc90e92 Bug 1436659 - Move playback rate test to timing-model; r=hiro
The test under web-animations/interfaces/Animation/playbackRate.html is really
testing the timing model so this patch moves it there. We'll simplify it in the
next patch.

MozReview-Commit-ID: HbhjlVtQLQA
2018-02-13 15:04:11 +09:00
Brian Birtles
5c75ab2181 Bug 1436659 - Use async/await in timing-model/animations tests; r=hiro
Using async/await makes these tests easier to read and appears to be supported
in all browsers now. This patch updates the tests in
web-animations/timing-model/animations since we will update these tests later in
this patch series and it will be easier if we convert them to using async first.

MozReview-Commit-ID: 70QKlkXTHW
2018-02-13 15:04:09 +09:00
Brian Birtles
8f636db1b4 Bug 1436659 - Rename tests in timing-model/animations to match spec section titles; r=hiro
In this folder we have a mixture of tests named after the procedure they are
testing or the section that contains the procedure. The latter seems to be more
common and makes it a little easier to check that all sections are tested so
this patch renames files to refer to the section titles instead. It also updates
a few of the test file titles and URLs.

MozReview-Commit-ID: 2udhvAKP5VR
2018-02-13 15:04:08 +09:00
arthur.iakab
db28ebefe0 Backed out 14 changesets (bug 1436659) for Eslint failures on devtools/server/actors/animation.js:876:12 on a CLOSED TREE
Backed out changeset a2890507d13a (bug 1436659)
Backed out changeset c653d7a1b3ef (bug 1436659)
Backed out changeset 4ae911f19aee (bug 1436659)
Backed out changeset e9381081ab6a (bug 1436659)
Backed out changeset 7301bfeeb65c (bug 1436659)
Backed out changeset 607dccfa8387 (bug 1436659)
Backed out changeset 8f61bf3de90a (bug 1436659)
Backed out changeset 920aa51ae3a2 (bug 1436659)
Backed out changeset bfa0d1a4bf1c (bug 1436659)
Backed out changeset 467dd218d3d3 (bug 1436659)
Backed out changeset 737ff1676ff0 (bug 1436659)
Backed out changeset 071666b6c7e9 (bug 1436659)
Backed out changeset c2932cd4839f (bug 1436659)
Backed out changeset a9777027b7ad (bug 1436659)
2018-02-14 22:40:07 +02:00
Brian Birtles
711ff68e19 Bug 1436659 - Add tests for Animation.updatePlaybackRate; r=hiro
These tests test the behavior introduced in the following changesets to the Web
Animations specification:

  1. 5af5e276ba
  2. 673f6fc126

which can be viewed as a merged diff at:

  https://gist.github.com/birtles/d147eb2e0e2d4d37fadf217abd709411

See the following spec issues:

  1. https://github.com/w3c/csswg-drafts/issues/2059
  2. https://github.com/w3c/csswg-drafts/issues/2266

MozReview-Commit-ID: 3XJHXIlgSwF
2018-02-13 15:04:18 +09:00
Brian Birtles
a3f1ac9ed7 Bug 1436659 - Further divide up finishing tests; r=hiro
MozReview-Commit-ID: FmYwTauidbv
2018-02-13 15:04:17 +09:00
Brian Birtles
ca2cd184f1 Bug 1436659 - Tidy up tests for "finishing an animation"; r=hiro
These patches update these tests as follows:

* Used async/await where it simplifies the tests
* Updated the test descriptions to reflect what they are testing in the timing
  model
* Fixed a couple of bugs where we set the playbackRate on a pause-pending
  animation (which causes it to no longer be pause-pending).

In the process I noticed a couple of tests that don't really belong here. They
will be moved in the next patch.

MozReview-Commit-ID: C33o7qLNMMd
2018-02-13 15:04:15 +09:00
Brian Birtles
58dc93e2cd Bug 1436659 - Move finishing tests to timing-model; r=hiro
These tests are not testing the interface so much as the 'finish an animation'
procedure.

This patch simply moves the tests as-is. They will be simplified in the next
patch in this series.

MozReview-Commit-ID: 5nloB5GtxHv
2018-02-13 15:04:14 +09:00
Brian Birtles
a991ed0b85 Bug 1436659 - Simplify playback rate setting test; r=hiro
I didn't like the way these tests were written so I decided to rewrite them to
make it more clear what they are trying to test.

MozReview-Commit-ID: IBqMUh24crS
2018-02-13 15:04:12 +09:00
Brian Birtles
76a8fc739a Bug 1436659 - Move playback rate test to timing-model; r=hiro
The test under web-animations/interfaces/Animation/playbackRate.html is really
testing the timing model so this patch moves it there. We'll simplify it in the
next patch.

MozReview-Commit-ID: HbhjlVtQLQA
2018-02-13 15:04:11 +09:00
Brian Birtles
e6559a1a86 Bug 1436659 - Use async/await in timing-model/animations tests; r=hiro
Using async/await makes these tests easier to read and appears to be supported
in all browsers now. This patch updates the tests in
web-animations/timing-model/animations since we will update these tests later in
this patch series and it will be easier if we convert them to using async first.

MozReview-Commit-ID: 70QKlkXTHW
2018-02-13 15:04:09 +09:00
Brian Birtles
46dc5440dd Bug 1436659 - Rename tests in timing-model/animations to match spec section titles; r=hiro
In this folder we have a mixture of tests named after the procedure they are
testing or the section that contains the procedure. The latter seems to be more
common and makes it a little easier to check that all sections are tested so
this patch renames files to refer to the section titles instead. It also updates
a few of the test file titles and URLs.

MozReview-Commit-ID: 2udhvAKP5VR
2018-02-13 15:04:08 +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
dedc4e6dca Bug 1425548 - Update references to Web Animations spec in web-platform-tests; r=hiro
MozReview-Commit-ID: EhP0qSOp0TA
2017-12-15 14:57:03 -06:00
Brian Birtles
f8797bea58 Bug 1422248 - Add tests that canceling an idle animation does not reject promises or fire events; r=hiro
Note that we don't need tests for the cancel events of CSS Animations or CSS
Transitions since we already have them in
dom/animation/test/css-{animations|transitions}/file_event-dispatch.html

(See the tests named "Call Animation.cancel after cancelling
transition/animation".)

MozReview-Commit-ID: GRtSxEvMkjz
2017-12-14 17:14:42 -06:00
Hiroyuki Ikezoe
32edad4424 Bug 1416966 - Test that there is a micro task checkpoint before requestAnimationFrame callbacks. r=birtles
The test intentionally uses async_test to avoid browser's awkward micro task
handling.

MozReview-Commit-ID: K5WzEML7D5M
2017-12-12 18:44:05 +09:00
Hiroyuki Ikezoe
e018771448 Bug 1416966 - Make sure the next frame happen in the case where we are in the callback for Animation.ready Promise. r=birtles
MozReview-Commit-ID: 86cnNoGgA9r
2017-12-12 18:44:04 +09:00
Brian Birtles
d71b65630a Bug 1412765 - Update web-platform-tests to test new pending member; r=hiro
Hopefully most of these changes are self-explanatory however a few notes follow.

* In timing-model/animations/play-states.html, as well as making the tests match
  the updated spec, one or two tests have also been moved to better reflect the
  order in the spec (to make it obvious which branch of the algorithm is being
  tested).

* In timing-model/animations/set-the-timeline-of-an-animation.html we previously
  had two tests that check:
  a) That the playState was 'pending' before and after setting the timeline.
  b) That the playState was 'pending' before setting the timeline and then,
     after setting the timeline and waiting on the ready promise, would become
     'running'.
  Likewise we had the same test for pausing.

  Since these are basically the same test--(b) just adds the wait on the ready
  promise--we combine them here into one test that covers both (a) and (b).

MozReview-Commit-ID: CLoDJvsdwmF
2017-11-21 17:12:01 +09:00
Brian Birtles
cdcb30152a Bug 1412765 - Move and rewrite playState.html test; r=hiro
Currently we have a test in interfaces/Animation/playState.html that somewhat
randomly tests the result of the `playState` member.

However, there's no complex logic associated with the `playState` member in the
IDL. It simply returns "The play state of this animation". The logic we need to
test is in the definition of 'play state' which is in the timing model.

As a result we move this test to timing-model/animations/play-states.html

However, this test as it stands does not test the calculation of the play state
in a particularly thorough manner. For example, it does not contain a single
test for the 'finished' state.

Given that this patch series will change the definition of the 'play state' we
first fix this test to cover each of the different cases in the definition of
the 'play state' prior to these changes. That is, we update the tests based on
the definition of 'play state' here:

  https://www.w3.org/TR/2016/WD-web-animations-1-20160913/#play-states

(Note that at this point in the patch series the pref to turn on the changed
definition behavior has not been enabled even for tests so this patch is
actually testing the behavior when that pref is false. We'll replace much of
this test in the next patch but by updating the test first, we should be able to
more clearly see the changes in the next patch.)

MozReview-Commit-ID: 1xkOmuY1SxD
2017-11-21 17:11:51 +09:00
Brian Birtles
42bc81cc76 Bug 1415448 - Use for...of instead of forEach in web-platform-tests/web-animations; r=hiro
MozReview-Commit-ID: CEMNCSEmpgr
2017-11-16 12:38:06 +09:00
Brian Birtles
5cafe31b56 Bug 1415448 - Use template literals in a few places in web-platform-tests/web-animations; r=hiro
This patch does not attempt to be exhaustive but fixes a few instances where to
are obvious benefits to using template literals.

MozReview-Commit-ID: A7iRY2oOOfV
2017-11-16 12:38:05 +09:00
Brian Birtles
ad84cab81f Bug 1415448 - Consistently use single quotes for string literals in web-platform-tests/web-animations; r=hiro
We will introduce template literals in the next patch in this series.

MozReview-Commit-ID: H0cF0SjI1U5
2017-11-16 12:38:04 +09:00
Brian Birtles
75ee2edbc3 Bug 1415448 - Replace var with const/let in web-platform-tests/web-animations; r=hiro
Because 'const' is longer than 'var', in quite a number of places this patch
also updates the indentation of subsequent lines.

Also, in a number of cases this means the line now needs to be wrapped. In
general I've used 'prettier' to do the line wrapping which means that the line
wrapping style differs a little from the existing code (which is already quite
inconsistent). Hopefully in the future we can use prettier on all files to make
this more consistent.

Also, in some cases, to avoid further line wrapping, this patch uses shorthand
property names (specifically replacing 'composite: composite' with just
'composite'). This appears to be supported in all browsers like to implement Web
Animations (Firefox 33+, Chrome 47+, Edge, Safari 9+).

MozReview-Commit-ID: 2xEaeZSYjlc
2017-11-16 12:37:54 +09:00
Brian Birtles
0cc4390a56 Bug 1415448 - Use arrow functions in web-platform-tests/web-animations; r=hiro
MozReview-Commit-ID: HE0vIxhhh3j
2017-11-16 12:37:14 +09:00
Brian Birtles
7813b5a152 Bug 1415448 - Tidy up titles of Web Animations web-platform-tests; r=hiro
It's not necessary to say "tests" or "tests for" in the title of these tests.
It's obvious from the context that these are test files.

This patch:

* Remove "Tests for" and "tests" from the titles
* Makes the titles match the spec sections they test more closely where
  practical
* Makes the titles more consistent in general (e.g. not putting () after method
  names)
* Updates a few spec links
* Drops a few author annotations since we decided to no longer use them

There are still some inconsistencies:

- The naming of the setTarget.html test file
- The location of the effect-value-visibility.html file
- The getComputedStyle.html test
- etc.

These will be fixed in subsequent patches in this series.
2017-11-10 17:07:56 +09:00
Brian Birtles
f7c2ee346d Bug 1411806 - Update test descriptions for document timeline tests; r=hiro
Now that some of these tests have been moved to the timing-model directory, it
makes less sense to refer to the actual API being tested. Intead they should
refer to the concept in the model being tested.

MozReview-Commit-ID: 7Y65o0IilSq
2017-10-27 13:37:13 +09:00
Brian Birtles
d77380afbd Bug 1411806 - Move document timeline tests to files corresponding to the sections in the spec they test; r=hiro
I replaced a couple instances of 'var' with 'const' or 'let' but otherwise the
test content is untouched. I will update a few test descriptions in the next
patch.

MozReview-Commit-ID: ASVp54dzQUL
2017-10-27 13:37:08 +09:00
Brian Birtles
25079ab175 Bug 1406381 - Update the simple iteration progress calculation to match recent changes to the Web Animations specification; r=hiro
This implements the following change to the Web Animations specification:

  19b6c33cee

The background to that change is described in the corresponding spec issue:

  https://github.com/w3c/web-animations/issues/201

MozReview-Commit-ID: GGA64LG5vT
2017-10-13 12:31:21 +09:00
Brian Birtles
3c780ae5dc Bug 1406381 - Add tests for simple iteration progress and current iteration when the playback rate is negative; r=hiro
MozReview-Commit-ID: H7cgEeGYUoj
2017-10-13 12:28:05 +09:00
Brian Birtles
221ec98670 Bug 1406381 - Extend assert_computed_timing_for_each_phase to accommodate negative playback rates; r=hiro
MozReview-Commit-ID: LpTRS6aMaWw
2017-10-13 12:27:56 +09:00
Brian Birtles
0d01724769 Bug 1406381 - Factor out common code from simple-iteration-progress.html and current-iteration.html; r=hiro
This will become all the more necessary when we extend these definitions to work
with negative playback rates.

MozReview-Commit-ID: ITHEqjprWUy
2017-10-13 10:53:10 +09:00
Brian Birtles
3a3b822d36 Bug 1406381 - Tidy up simple-iteration-progress.html and current-iteration.html somewhat; r=hiro
This is in preparation for further changes to these files later in this patch
series.

In particular this patch:

* Moves some code to more modern Javascript that should be easier to read and
  maintain

* Makes the tests more strict about when active/after values are specified
  - If the timing parameters mean there is no active phase, the test should not
    specify a value to test for that phase. If there *is* an active phase, the
    test must provide a value to test (if it does not the test will fails when
    it compares against the undefined value).
  - Likewise for the after phase
  This should make it a little easier to incorporate testing the playbackRate.

MozReview-Commit-ID: 17vihK5RSbu
2017-10-13 10:45:58 +09:00
James Graham
a99f828ced Bug 1363982 - Update web-platform-tests to revision db6ed4bb451e44748cbb9af69d0a01c17a33571a a=testonly
MozReview-Commit-ID: KjIquC2PKKI
2017-05-11 18:01:46 +01:00
James Graham
99f3698b17 Bug 1356225 - Update web-platform-tests to revision d519fe9011da7cfce7949f7ed826e9759dc5c532, a=testonly
MozReview-Commit-ID: GmGgeZxHy0j
2017-04-20 10:49:24 +01:00
Sebastian Hengst
ae83546ec4 Backed out changeset e7024412b94e (bug 1356225)
MozReview-Commit-ID: Ib8aOAM6cQ2
2017-04-14 17:18:47 +02:00
James Graham
468eebfa83 Bug 1356225 - Update web-platform-tests to revision d519fe9011da7cfce7949f7ed826e9759dc5c532, a=testonly
MozReview-Commit-ID: GmGgeZxHy0j
2017-04-13 16:22:32 +01:00
Brian Birtles
b35a590775 Bug 1343589 - Add tests that the playback rate is updated silently r=hiro
The spec[1] says:

  Silently set the animation playback rate of animation to -animation playback
  rate.

  This must be done silently or else we may end up resolving the current
  ready promise when we do the compensatory seek despite the fact that we are
  most likely not exiting the pending play state.

This patch add tests that we don't exit the pending play state when calling
reverse() or resolve the ready promise.

[1] https://w3c.github.io/web-animations/#reverse-an-animation

MozReview-Commit-ID: 1X42O5yKpk9
2017-03-28 14:51:53 +09:00
Brian Birtles
0c49750de7 Bug 1343589 - Add a test for reversing with an infinite target effect end and playback rate of zero r=hiro
We already pass this test but it seemed like a useful test to add since I was
unsure if the early return we have in Animation::Reverse() is valid or not.

MozReview-Commit-ID: J38Euno3VP6
2017-03-28 14:51:53 +09:00
Brian Birtles
b07053a962 Bug 1343589 - Add a test that the playback rate is unaffected when an exception is thrown r=hiro
The spec has been updated to clarify that this is the expected behavior:

  c80c9984ca

MozReview-Commit-ID: 6TsNg7HWdRX
2017-03-28 14:51:51 +09:00
Brian Birtles
bc9d8fa193 Bug 1343589 - Move tests for reversing an animation to the timing-model folder r=hiro
We are gradually line the tests up better with sections in the spec. Given that
these tests are concerned with testing the "reverse an animation" procedure in
the spec (and not the API per se) they should be moved to an appropriate
subdirectory of timing-model.

We also update the test titles to make it clear that these tests are really
covering the timing model, not the API.

MozReview-Commit-ID: J5gc3HZg9qv
2017-03-28 14:51:50 +09:00
James Graham
4d6265f684 Bug 1345490 - Update web-platform-tests to revision 7c7db1b516b01394e19fad80094fbb81ab02ce75, a=testonly
MozReview-Commit-ID: 4wsHtf9312c
2017-03-17 14:34:25 +00:00
Sebastian Hengst
d0fc10c1f0 Backed out changeset d1a5149f5e9b (bug 1345490) for OSX, Windows and Linux stylo reftests and marionette failing with "No module named six.moves.urllib.parse". r=backout 2017-03-15 19:24:26 +01:00
James Graham
398d1d56dc Bug 1345490 - Update web-platform-tests to revision 7c7db1b516b01394e19fad80094fbb81ab02ce75, a=testonly
MozReview-Commit-ID: 4wsHtf9312c
2017-03-15 15:20:53 +00:00
Boris Chiou
2be714e35e Bug 1248340 - Part 8: Add tests for transformed-progress and input progress outside [0, 1]. r=birtles
MozReview-Commit-ID: 4t3fx3Adkhj
2017-03-02 17:21:35 +08:00
James Graham
04c270e3d2 Bug 1340474 - Update web-platform-tests to revision eba2c70d536caaeef540966bc8ac7822417ab867, a=testonly
MozReview-Commit-ID: 1GaV7z8d0Xc
2017-02-20 11:52:05 +00:00