summaryrefslogtreecommitdiffstats
path: root/LayoutTests
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests')
-rw-r--r--LayoutTests/fast/animation/request-animation-frame-timestamps-advance-expected.txt11
-rw-r--r--LayoutTests/fast/animation/request-animation-frame-timestamps-advance.html15
-rw-r--r--LayoutTests/fast/animation/script-tests/request-animation-frame-timestamps-advance.js37
3 files changed, 63 insertions, 0 deletions
diff --git a/LayoutTests/fast/animation/request-animation-frame-timestamps-advance-expected.txt b/LayoutTests/fast/animation/request-animation-frame-timestamps-advance-expected.txt
new file mode 100644
index 0000000..ff09010
--- /dev/null
+++ b/LayoutTests/fast/animation/request-animation-frame-timestamps-advance-expected.txt
@@ -0,0 +1,11 @@
+Tests the timestamps provided to requestAnimationFrame callbacks advance
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS firstTimestamp is defined.
+PASS secondTimestamp is defined.
+PASS secondTimestamp > firstTimestamp is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
diff --git a/LayoutTests/fast/animation/request-animation-frame-timestamps-advance.html b/LayoutTests/fast/animation/request-animation-frame-timestamps-advance.html
new file mode 100644
index 0000000..b66b511
--- /dev/null
+++ b/LayoutTests/fast/animation/request-animation-frame-timestamps-advance.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" href="../js/resources/js-test-style.css">
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<span id="e"></span>
+<span id="f"></span>
+<script src="script-tests/request-animation-frame-timestamps-advance.js"></script>
+<script src="../js/resources/js-test-post-function.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/animation/script-tests/request-animation-frame-timestamps-advance.js b/LayoutTests/fast/animation/script-tests/request-animation-frame-timestamps-advance.js
new file mode 100644
index 0000000..52d9b90
--- /dev/null
+++ b/LayoutTests/fast/animation/script-tests/request-animation-frame-timestamps-advance.js
@@ -0,0 +1,37 @@
+description("Tests the timestamps provided to requestAnimationFrame callbacks advance");
+
+function busyWait(millis) {
+ var start = Date.now();
+ while (Date.now()-start < millis) {}
+}
+
+var firstTimestamp = undefined;
+var secondTimestamp = undefined;
+
+window.webkitRequestAnimationFrame(function(timestamp) {
+ firstTimestamp = timestamp;
+ shouldBeDefined("firstTimestamp");
+ window.webkitRequestAnimationFrame(function(timestamp) {
+ secondTimestamp = timestamp;
+ shouldBeDefined("secondTimestamp");
+ shouldBeTrue("secondTimestamp > firstTimestamp");
+ isSuccessfullyParsed();
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ });
+ busyWait(10);
+ if (window.layoutTestController)
+ layoutTestController.display();
+});
+
+
+if (window.layoutTestController)
+ window.setTimeout(function() {
+ layoutTestController.display();
+ });
+
+
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+var successfullyParsed = true;