Update web-platform-tests to revision 0d318188757a9c996e20b82db201fd04de5aa255

This commit is contained in:
James Graham 2015-03-27 09:15:38 +00:00
parent b2a5225831
commit 1a81b18b9f
12321 changed files with 544385 additions and 6 deletions

View file

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>window.performance.now exists</title>
<link rel="author" title="W3C" href="http://www.w3.org/" />
<link rel="help" href="http://www.w3.org/TR/hr-time/#sec-extenstions-performance-interface"/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link rel="stylesheet" href="/resources/testharness.css" />
<script>
test(function() {
assert_equals(typeof window.performance, "object");
}, "window.performance is defined", {assert: "The window.performance attribute provides a hosting area for performance related attributes."});
test(function() {
assert_not_equals(window.performance.now, undefined, 'window.performance.now is defined');
}, "High Resolution Time extension to the Performance interface", {assert: "window.performance.now exists"});
test(function() {
assert_equals(typeof window.performance.now, "function", "window.performance.now is a function");
}, "window.performance.now() function", {assert: "window.performance.now is a function"});
test(function() {
assert_equals(typeof window.performance.now(), "number", "window.performance.now() returns a number");
}, "window.performance.now() returns a number", {assert: "The now method MUST return a DOMHighResTimeStamp"});
</script>
</head>
<body>
<h1>Description</h1>
<p>This test validates that window.performance.now() exist and is a function.</p>
<div id="log"></div>
</body>
</html>

View file

@ -0,0 +1,53 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>High Resolution Time IDL tests</title>
<link rel="author" title="W3C" href="http://www.w3.org/" />
<link rel="help" href="http://www.w3.org/TR/hr-time/#sec-extenstions-performance-interface"/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/WebIDLParser.js"></script>
<script src="/resources/idlharness.js"></script>
</head>
<body>
<h1>High Resolution Time IDL tests</h1>
<div id="log"></div>
<pre id='untested_idl' style='display:none'>
interface Window {
};
interface Performance {
};
partial interface Window {
[Replaceable] readonly attribute Performance performance;
};
</pre>
<pre id='idl'>
typedef double DOMHighResTimeStamp;
partial interface Performance {
DOMHighResTimeStamp now();
};
</pre>
<script>
(function() {
var idl_array = new IdlArray();
idl_array.add_untested_idls(document.getElementById("untested_idl").textContent);
idl_array.add_idls(document.getElementById("idl").textContent);
idl_array.add_objects({Performance: ["window.performance"]});
idl_array.test();
})();
</script>
</body>
</html>

View file

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>window.performance.now() chronology</title>
<link rel="author" title="W3C" href="http://www.w3.org/" />
<link rel="help" href="http://www.w3.org/TR/hr-time/#sec-monotonic-clock"/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link rel="stylesheet" href="/resources/testharness.css" />
<script>
test(function() {
assert_true(window.performance.now() > 0, "window.performance.now() returns positive numbers");
}, "window.performance.now() returns a positive number", {assert: "The time values returned when calling the now method MUST be monotonically increasing and not subject to system clock adjustments or system clock skew."});
test(function() {
var now1 = window.performance.now();
var now2 = window.performance.now();
assert_true((now2-now1) >= 0, "window.performance.now() difference is not negative");
},
"window.performance.now() difference is not negative",
{
assert: "The difference between any two chronologically recorded time values returned from the now method MUST never be negative."
}
);
</script>
</head>
<body>
<h1>Description</h1>
<p>This test validates that window.performance.now() follows the monotonic clock requirements.</p>
<div id="log"></div>
</body>
</html>

View file

@ -0,0 +1,9 @@
<!DOCTYPE HTML>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>window.performance.now frame</title>
<link rel="author" title="Google" href="http://www.google.com/" />
</head>
<body></body>
</html>

View file

@ -0,0 +1,56 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" >
<title>window.performance.now across frames</title>
<link rel="author" title="Google" href="http://www.google.com/">
<link rel="help" href="http://www.w3.org/TR/hr-time/#sec-extenstions-performance-interface">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script type="text/javascript">
setup({explicit_done: true});
function start_test() {
setTimeout(function() {
var iframe = document.createElement('iframe');
iframe.id = 'frameContext';
iframe.onload = finish_test;
iframe.src = "resources/now_frame.html";
document.body.appendChild(iframe);
}, 1000);
}
function finish_test() {
var childWindow = document.getElementById('frameContext').contentWindow;
// Verify a positive number is returned for both the frame and parent.
test(function() { assert_true(window.performance.now() > 0); }, 'parent performance.now() > 0');
test(function() { assert_true(childWindow.performance.now() > 0); }, 'child performance.now() > 0');
// Verify that the test properly created the child at least a second after the parent.
test(function () { assert_true(childWindow.performance.timing.navigationStart > (window.performance.timing.navigationStart + 1000)); },
'Child created at least 1 second after parent');
test(function () {
var parentNow = window.performance.now();
var childNow = childWindow.performance.now();
var childParentSkew = Math.abs(childNow - parentNow);
assert_true(childParentSkew > 1000, 'Child and parent\'s now()s have different bases (skewed more than 1 second)');
var childLoadTime = childWindow.performance.timing.loadEventStart - childWindow.performance.timing.navigationStart;
assert_true(1000 > (childNow - childLoadTime), 'Child\'s now() is based on its document\'s navigationStart');
}, 'Child and parent time bases are correct');
done();
}
</script>
</head>
<body onload="start_test()">
<h1>Description</h1>
<p>This test validates the values of the window.performance.now() are based on the current document's navigationStart.</p>
<div id="log"></div>
</body>
</html>