Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (211659 => 211660)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2017-02-04 01:20:53 UTC (rev 211659)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2017-02-04 01:39:19 UTC (rev 211660)
@@ -1,3 +1,29 @@
+2017-02-03 Joseph Pecoraro <pecor...@apple.com>
+
+ Import web-platform-tests/hr-time tests
+ https://bugs.webkit.org/show_bug.cgi?id=167819
+
+ Reviewed by Youenn Fablet.
+
+ We pass all of these tests upstream.
+
+ * resources/ImportExpectations:
+ * web-platform-tests/hr-time/OWNERS: Added.
+ * web-platform-tests/hr-time/basic-expected.txt: Added.
+ * web-platform-tests/hr-time/basic.html: Added.
+ * web-platform-tests/hr-time/basic.worker-expected.txt: Added.
+ * web-platform-tests/hr-time/basic.worker.html: Added.
+ * web-platform-tests/hr-time/basic.worker.js: Added.
+ * web-platform-tests/hr-time/idlharness-expected.txt: Added.
+ * web-platform-tests/hr-time/idlharness.html: Added.
+ * web-platform-tests/hr-time/monotonic-clock-expected.txt: Added.
+ * web-platform-tests/hr-time/monotonic-clock.html: Added.
+ * web-platform-tests/hr-time/resources/now_frame.html: Added.
+ * web-platform-tests/hr-time/resources/w3c-import.log: Added.
+ * web-platform-tests/hr-time/test_cross_frame_start-expected.txt: Added.
+ * web-platform-tests/hr-time/test_cross_frame_start.html: Added.
+ * web-platform-tests/hr-time/w3c-import.log: Added.
+
2017-02-03 Alex Christensen <achristen...@webkit.org>
URLParser: implement forbidden host code points for non-special URLs
Modified: trunk/LayoutTests/imported/w3c/resources/ImportExpectations (211659 => 211660)
--- trunk/LayoutTests/imported/w3c/resources/ImportExpectations 2017-02-04 01:20:53 UTC (rev 211659)
+++ trunk/LayoutTests/imported/w3c/resources/ImportExpectations 2017-02-04 01:39:19 UTC (rev 211660)
@@ -167,7 +167,7 @@
web-platform-tests/gamepad [ Skip ]
web-platform-tests/geolocation-API [ Skip ]
web-platform-tests/gyroscope [ Skip ]
-web-platform-tests/hr-time [ Skip ]
+#web-platform-tests/hr-time [ Pass ]
#web-platform-tests/html [ Pass ]
web-platform-tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name.html [ Skip ]
web-platform-tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin_2.html [ Skip ]
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/OWNERS (0 => 211660)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/OWNERS (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/OWNERS 2017-02-04 01:39:19 UTC (rev 211660)
@@ -0,0 +1,3 @@
+@plehegar
+@igrigorik
+@toddreifsteck
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/basic-expected.txt (0 => 211660)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/basic-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/basic-expected.txt 2017-02-04 01:39:19 UTC (rev 211660)
@@ -0,0 +1,11 @@
+Description
+
+This test validates that window.performance.now() exist and is a function.
+
+
+PASS window.performance is defined
+PASS High Resolution Time extension to the Performance interface
+PASS window.performance.now() function
+PASS window.performance.now() returns a number
+PASS High resolution time has approximately the right relative magnitude
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/basic.html (0 => 211660)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/basic.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/basic.html 2017-02-04 01:39:19 UTC (rev 211660)
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8" />
+<title>window.performance.now exists</title>
+<link rel="author" title="W3C" href="" />
+<link rel="help" href=""
+<script src=""
+<script src=""
+<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"});
+
+async_test(function() {
+ // Check whether the performance.now() method is close to Date() within 30ms (due to inaccuracies)
+ var initial_hrt = performance.now();
+ var initial_date = Date.now();
+ this.step_timeout(function() {
+ var final_hrt = performance.now();
+ var final_date = Date.now();
+ assert_approx_equals(final_hrt - initial_hrt, final_date - initial_date, 30, 'High resolution time value increased by approximately the same amount as time from date object');
+ this.done();
+ }, 2000);
+}, 'High resolution time has approximately the right relative magnitude');
+</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>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/basic.worker-expected.txt (0 => 211660)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/basic.worker-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/basic.worker-expected.txt 2017-02-04 01:39:19 UTC (rev 211660)
@@ -0,0 +1,5 @@
+
+PASS WorkerGlobalScope.performance.now() is a function
+PASS WorkerGlobalScope.performance.now() returns a positive number
+PASS WorkerGlobalScope.performance.now() difference is not negative
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/basic.worker.html (0 => 211660)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/basic.worker.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/basic.worker.html 2017-02-04 01:39:19 UTC (rev 211660)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/basic.worker.js (0 => 211660)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/basic.worker.js (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/basic.worker.js 2017-02-04 01:39:19 UTC (rev 211660)
@@ -0,0 +1,18 @@
+importScripts("/resources/testharness.js");
+
+test(function() {
+ assert_true((performance !== undefined), "WorkerGlobalScope.performance exists");
+ assert_equals((typeof performance.now), "function");
+}, "WorkerGlobalScope.performance.now() is a function");
+
+test(function() {
+ assert_true(performance.now() > 0);
+}, "WorkerGlobalScope.performance.now() returns a positive number");
+
+test(function() {
+ var now1 = performance.now();
+ var now2 = performance.now();
+ assert_true((now2-now1) >= 0);
+ }, "WorkerGlobalScope.performance.now() difference is not negative");
+
+done();
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/idlharness-expected.txt (0 => 211660)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/idlharness-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/idlharness-expected.txt 2017-02-04 01:39:19 UTC (rev 211660)
@@ -0,0 +1,37 @@
+High Resolution Time IDL tests
+
+
+FAIL Window interface: attribute performance assert_true: The prototype object must have a property "performance" expected true got false
+PASS WorkerGlobalScope interface: existence and properties of interface object
+FAIL Performance interface: existence and properties of interface object undefined is not an object (evaluating 'this.array
+ .members[this.base]
+ .has_extended_attribute')
+PASS Performance interface object length
+PASS Performance interface object name
+FAIL Performance interface: existence and properties of interface prototype object undefined is not an object (evaluating 'this.array
+ .members[inherit_interface]
+ .has_extended_attribute')
+PASS Performance interface: existence and properties of interface prototype object's "constructor" property
+PASS Performance interface: operation now()
+PASS Performance must be primary interface of window.performance
+FAIL Stringification of window.performance undefined is not an object (evaluating 'this.array.members[this.base].has_stringifier')
+PASS Performance interface: window.performance must inherit property "now" with the proper type (0)
+typedef double DOMHighResTimeStamp;
+
+[Exposed=(Window,Worker)]
+interface Performance : EventTarget {
+ DOMHighResTimeStamp now();
+ serializer = {attribute};
+};
+
+[NoInterfaceObject,
+ Exposed=(Window,Worker)]
+interface GlobalPerformance {
+ [Replaceable]
+ readonly attribute Performance performance;
+};
+
+Window implements GlobalPerformance;
+
+WorkerGlobalScope implements GlobalPerformance;
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/idlharness.html (0 => 211660)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/idlharness.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/idlharness.html 2017-02-04 01:39:19 UTC (rev 211660)
@@ -0,0 +1,64 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>High Resolution Time IDL tests</title>
+<link rel="author" title="W3C" href="" />
+<link rel="help" href=""
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<h1>High Resolution Time IDL tests</h1>
+<div id="log"></div>
+
+<pre id='untested_idl' style='display:none'>
+
+interface Window {
+};
+
+[Exposed=Worker]
+interface WorkerGlobalScope {
+};
+
+</pre>
+
+<pre id='idl'>
+typedef double DOMHighResTimeStamp;
+
+[Exposed=(Window,Worker)]
+interface Performance : EventTarget {
+ DOMHighResTimeStamp now();
+ serializer = {attribute};
+};
+
+[NoInterfaceObject,
+ Exposed=(Window,Worker)]
+interface GlobalPerformance {
+ [Replaceable]
+ readonly attribute Performance performance;
+};
+
+Window implements GlobalPerformance;
+
+WorkerGlobalScope implements GlobalPerformance;
+</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>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/monotonic-clock-expected.txt (0 => 211660)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/monotonic-clock-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/monotonic-clock-expected.txt 2017-02-04 01:39:19 UTC (rev 211660)
@@ -0,0 +1,8 @@
+Description
+
+This test validates that window.performance.now() follows the monotonic clock requirements.
+
+
+PASS window.performance.now() returns a positive number
+PASS window.performance.now() difference is not negative
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/monotonic-clock.html (0 => 211660)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/monotonic-clock.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/monotonic-clock.html 2017-02-04 01:39:19 UTC (rev 211660)
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8" />
+<title>window.performance.now() chronology</title>
+<link rel="author" title="W3C" href="" />
+<link rel="help" href=""
+<script src=""
+<script src=""
+<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>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/resources/now_frame.html (0 => 211660)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/resources/now_frame.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/resources/now_frame.html 2017-02-04 01:39:19 UTC (rev 211660)
@@ -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="" />
+ </head>
+ <body></body>
+</html>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/resources/w3c-import.log (0 => 211660)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/resources/w3c-import.log (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/resources/w3c-import.log 2017-02-04 01:39:19 UTC (rev 211660)
@@ -0,0 +1,18 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the W3C CSS or WPT github:
+ https://github.com/w3c/csswg-test
+ https://github.com/w3c/web-platform-tests
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/hr-time/resources/now_frame.html
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/test_cross_frame_start-expected.txt (0 => 211660)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/test_cross_frame_start-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/test_cross_frame_start-expected.txt 2017-02-04 01:39:19 UTC (rev 211660)
@@ -0,0 +1,11 @@
+Description
+
+This test validates the values of the window.performance.now() are based on the current document's navigationStart.
+
+
+PASS Setup the frame
+PASS parent performance.now() > 0
+PASS child performance.now() > 0
+FAIL Child created at least 1 second after parent assert_true: expected true got false
+FAIL Child and parent time bases are correct assert_true: Child and parent's now()s have different bases (skewed more than 1 second) expected true got false
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/test_cross_frame_start.html (0 => 211660)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/test_cross_frame_start.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/test_cross_frame_start.html 2017-02-04 01:39:19 UTC (rev 211660)
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" >
+ <title>window.performance.now across frames</title>
+ <link rel="author" title="Google" href=""
+ <link rel="help" href=""
+
+ <script src=""
+ <script src=""
+
+ <script type="text/_javascript_">
+ setup({explicit_done: true});
+
+ var setup_frame = async_test("Setup the frame");
+
+ function start_test() {
+ setup_frame.step_timeout(function () {
+ var iframe = document.createElement('iframe');
+ iframe.id = 'frameContext';
+ iframe._onload_ = finish_test;
+ iframe.src = ""
+ document.body.appendChild(iframe);
+ setup_frame.done();
+ }, 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>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/w3c-import.log (0 => 211660)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/w3c-import.log (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/hr-time/w3c-import.log 2017-02-04 01:39:19 UTC (rev 211660)
@@ -0,0 +1,23 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the W3C CSS or WPT github:
+ https://github.com/w3c/csswg-test
+ https://github.com/w3c/web-platform-tests
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/hr-time/OWNERS
+/LayoutTests/imported/w3c/web-platform-tests/hr-time/basic.html
+/LayoutTests/imported/w3c/web-platform-tests/hr-time/basic.worker.js
+/LayoutTests/imported/w3c/web-platform-tests/hr-time/idlharness.html
+/LayoutTests/imported/w3c/web-platform-tests/hr-time/monotonic-clock.html
+/LayoutTests/imported/w3c/web-platform-tests/hr-time/test_cross_frame_start.html