Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / web-animations-api / timeline-time.html
bloba608400be4b1a80c6c1b3567e65cc99d191dc0a3
1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
5 <script>
6 test(function() {
7 var startTime = document.timeline.currentTime;
8 assert_greater_than_equal(startTime, 0);
9 var start = performance.now();
10 while (performance.now() < start + 250)
11 /* wait */;
12 assert_equals(document.timeline.currentTime, startTime);
13 }, 'document.timeline.currentTime should not change within a script block.');
15 (function() {
16 var timeoutTest = async_test('document.timeline.currentTime time should change after a script timeout');
17 var startTime = document.timeline.currentTime;
19 setTimeout(function() {
20 timeoutTest.step(function() {
21 assert_greater_than(document.timeline.currentTime, startTime);
22 });
23 timeoutTest.done();
24 }, 100);
25 })();
27 (function() {
28 var rafTest = async_test('document.timeline.currentTime time should be the same for all RAF callbacks in a frame');
29 var startTime = document.timeline.currentTime;
30 var firstRafTime;
32 requestAnimationFrame(function() {
33 rafTest.step(function() {
34 assert_greater_than_equal(document.timeline.currentTime, startTime);
35 firstRafTime = document.timeline.currentTime;
36 });
37 });
39 requestAnimationFrame(function() {
40 rafTest.step(function() {
41 assert_equals(document.timeline.currentTime, firstRafTime);
42 });
43 rafTest.done();
44 });
45 })();
47 (function() {
48 var timeoutTest = async_test('document.timeline.currentTime time should use the same reference as performance.now()');
50 setTimeout(function() {
51 timeoutTest.step(function() {
52 assert_less_than(Math.abs(document.timeline.currentTime - performance.now()), 1000);
53 });
54 timeoutTest.done();
55 }, 0);
56 })();
57 </script>