Title: [277408] trunk/LayoutTests
Revision
277408
Author
[email protected]
Date
2021-05-12 16:24:22 -0700 (Wed, 12 May 2021)

Log Message

[LayoutTests] http/tests/misc/last-modified-parsing.html handles non-standard dates differently in PHP than Python
https://bugs.webkit.org/show_bug.cgi?id=224933
<rdar://problem/77020039>

Reviewed by Jonathan Bedard.

* http/tests/misc/last-modified-parsing-expected.txt: Removed.
* http/tests/misc/last-modified-parsing.html: Removed.
* http/tests/misc/no-last-modified-expected.txt: Removed.
* http/tests/misc/no-last-modified.html: Removed.
* http/tests/resources/last-modified.php: Removed.
* http/wpt/misc: Added.
* http/wpt/misc/last-modified-parsing-expected.txt: Added.
* http/wpt/misc/last-modified-parsing.html: Added.
* http/wpt/misc/no-last-modified-expected.txt: Added.
* http/wpt/misc/no-last-modified.html: Added.
* http/wpt/misc/resources: Added.
* http/wpt/misc/resources/last-modified-utilities.js: Added.
(async getLastModified):
* platform/win/TestExpectations:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (277407 => 277408)


--- trunk/LayoutTests/ChangeLog	2021-05-12 23:22:58 UTC (rev 277407)
+++ trunk/LayoutTests/ChangeLog	2021-05-12 23:24:22 UTC (rev 277408)
@@ -1,3 +1,26 @@
+2021-05-12  Chris Gambrell  <[email protected]>
+
+        [LayoutTests] http/tests/misc/last-modified-parsing.html handles non-standard dates differently in PHP than Python
+        https://bugs.webkit.org/show_bug.cgi?id=224933
+        <rdar://problem/77020039>
+
+        Reviewed by Jonathan Bedard.
+
+        * http/tests/misc/last-modified-parsing-expected.txt: Removed.
+        * http/tests/misc/last-modified-parsing.html: Removed.
+        * http/tests/misc/no-last-modified-expected.txt: Removed.
+        * http/tests/misc/no-last-modified.html: Removed.
+        * http/tests/resources/last-modified.php: Removed.
+        * http/wpt/misc: Added.
+        * http/wpt/misc/last-modified-parsing-expected.txt: Added.
+        * http/wpt/misc/last-modified-parsing.html: Added.
+        * http/wpt/misc/no-last-modified-expected.txt: Added.
+        * http/wpt/misc/no-last-modified.html: Added.
+        * http/wpt/misc/resources: Added.
+        * http/wpt/misc/resources/last-modified-utilities.js: Added.
+        (async getLastModified):
+        * platform/win/TestExpectations:
+
 2021-05-12  Robert Jenner  <[email protected]>
 
         [ Catalina+ wk2 ] http/tests/webAPIStatistics/screen-functions-accessed-data-collection.html (layout-test) is a flaky timeout

Deleted: trunk/LayoutTests/http/tests/misc/last-modified-parsing-expected.txt (277407 => 277408)


--- trunk/LayoutTests/http/tests/misc/last-modified-parsing-expected.txt	2021-05-12 23:22:58 UTC (rev 277407)
+++ trunk/LayoutTests/http/tests/misc/last-modified-parsing-expected.txt	2021-05-12 23:24:22 UTC (rev 277408)
@@ -1,36 +0,0 @@
-
-
---------
-Frame: '<!--frame1-->'
---------
-Fri, 21 Nov 2008 01:03:33 GMT
-
---------
-Frame: '<!--frame2-->'
---------
-Fri, 21 Nov 2008 01:03:33 GMT
-
---------
-Frame: '<!--frame3-->'
---------
-Fri, 21 Nov 1997 01:03:33 GMT
-
---------
-Frame: '<!--frame4-->'
---------
-Fri, 21 Nov 2008 01:03:33 GMT
-
---------
-Frame: '<!--frame5-->'
---------
-Thu, 21 Feb 2008 01:03:33 GMT
-
---------
-Frame: '<!--frame6-->'
---------
-Sun, 03 Feb 2008 01:03:33 GMT
-
---------
-Frame: '<!--frame7-->'
---------
-Mon, 03 Mar 2008 01:03:33 GMT

Deleted: trunk/LayoutTests/http/tests/misc/last-modified-parsing.html (277407 => 277408)


--- trunk/LayoutTests/http/tests/misc/last-modified-parsing.html	2021-05-12 23:22:58 UTC (rev 277407)
+++ trunk/LayoutTests/http/tests/misc/last-modified-parsing.html	2021-05-12 23:24:22 UTC (rev 277408)
@@ -1,18 +0,0 @@
-<script>
-if (window.testRunner) {
-    testRunner.dumpAsText();
-    testRunner.dumpChildFramesAsText();
-}
-
-function test(text) {
-    document.write('<iframe src="" + escape(text) + '"></iframe>');
-}
-
-test('Mon, 21 Nov 2008 01:03:33 GMT');
-test('Tuesday, 21 Nov 2008 01:03:33 GMT');
-test('Mon, 21 Nov 97 01:03:33 GMT');
-test('Mon, 21-Nov-2008 01:03:33 GMT');
-test('Mon, 21-Feb-2008 01:03:33 GMT');
-test('Mon, 03-Feb-2008 01:03:33 GMT');
-test('Mon, 3-Mar-2008 01:03:33 GMT');
-</script>

Deleted: trunk/LayoutTests/http/tests/misc/no-last-modified-expected.txt (277407 => 277408)


--- trunk/LayoutTests/http/tests/misc/no-last-modified-expected.txt	2021-05-12 23:22:58 UTC (rev 277407)
+++ trunk/LayoutTests/http/tests/misc/no-last-modified-expected.txt	2021-05-12 23:24:22 UTC (rev 277408)
@@ -1,2 +0,0 @@
-ALERT: PASS
-

Deleted: trunk/LayoutTests/http/tests/misc/no-last-modified.html (277407 => 277408)


--- trunk/LayoutTests/http/tests/misc/no-last-modified.html	2021-05-12 23:22:58 UTC (rev 277407)
+++ trunk/LayoutTests/http/tests/misc/no-last-modified.html	2021-05-12 23:24:22 UTC (rev 277408)
@@ -1,19 +0,0 @@
-<script>
-if (window.testRunner)
-    testRunner.dumpAsText();
-
-function test(text) {
-    document.write('<iframe src="" + escape(text) + '"></iframe>');
-}
-
-test('');
-
-window._onload_ = function() {
-    var lastModified = Date.parse(frames[0].document.body.textContent);
-    var now = new Date();
-    if (lastModified > now - (24+1)*60*60*1000)
-        alert('PASS');
-    else
-        alert('FAIL');
-}
-</script>

Deleted: trunk/LayoutTests/http/tests/resources/last-modified.php (277407 => 277408)


--- trunk/LayoutTests/http/tests/resources/last-modified.php	2021-05-12 23:22:58 UTC (rev 277407)
+++ trunk/LayoutTests/http/tests/resources/last-modified.php	2021-05-12 23:24:22 UTC (rev 277408)
@@ -1,7 +0,0 @@
-<?php
-    $date = $_GET['date'];
-    header("Last-Modified: $date");
-?>
-<script>
-document.write((new Date(document.lastModified)).toUTCString());
-</script>

Added: trunk/LayoutTests/http/wpt/misc/last-modified-parsing-expected.txt (0 => 277408)


--- trunk/LayoutTests/http/wpt/misc/last-modified-parsing-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/wpt/misc/last-modified-parsing-expected.txt	2021-05-12 23:24:22 UTC (rev 277408)
@@ -0,0 +1,11 @@
+Last-Modified: Parsing
+
+
+PASS Last-Modified date Mon, 21 Nov 2008 01:03:33 GMT
+PASS Last-Modified date Tuesday, 21 Nov 2008 01:03:33 GMT
+PASS Last-Modified date Mon, 21 Nov 97 01:03:33 GMT
+PASS Last-Modified date Mon, 21-Nov-2008 01:03:33 GMT
+PASS Last-Modified date Mon, 21-Feb-2008 01:03:33 GMT
+PASS Last-Modified date Mon, 03-Feb-2008 01:03:33 GMT
+PASS Last-Modified date Mon, 3-Mar-2008 01:03:33 GMT
+

Added: trunk/LayoutTests/http/wpt/misc/last-modified-parsing.html (0 => 277408)


--- trunk/LayoutTests/http/wpt/misc/last-modified-parsing.html	                        (rev 0)
+++ trunk/LayoutTests/http/wpt/misc/last-modified-parsing.html	2021-05-12 23:24:22 UTC (rev 277408)
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Last-Modified - Parsing</title>
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<h1>Last-Modified: Parsing</h1>
+<div id="log"></div>
+<script>
+function test_last_modified(date) {
+    promise_test(async () => {
+        let actual = await getLastModified(date);
+        assert_equals((new Date(Date.parse(actual)).toUTCString()), (new Date(Date.parse(date)).toUTCString()));
+    }, "Last-Modified date " + date);
+}
+
+
+test_last_modified("Mon, 21 Nov 2008 01:03:33 GMT");
+test_last_modified("Tuesday, 21 Nov 2008 01:03:33 GMT");
+test_last_modified("Mon, 21 Nov 97 01:03:33 GMT");
+test_last_modified("Mon, 21-Nov-2008 01:03:33 GMT");
+test_last_modified("Mon, 21-Feb-2008 01:03:33 GMT");
+test_last_modified("Mon, 03-Feb-2008 01:03:33 GMT");
+test_last_modified("Mon, 3-Mar-2008 01:03:33 GMT");
+</script>
+</body>
+</html>
Property changes on: trunk/LayoutTests/http/wpt/misc/last-modified-parsing.html
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Added: trunk/LayoutTests/http/wpt/misc/no-last-modified-expected.txt (0 => 277408)


--- trunk/LayoutTests/http/wpt/misc/no-last-modified-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/wpt/misc/no-last-modified-expected.txt	2021-05-12 23:24:22 UTC (rev 277408)
@@ -0,0 +1,5 @@
+Last-Modified: No Date
+
+
+PASS Last-Modified sent with no date
+

Added: trunk/LayoutTests/http/wpt/misc/no-last-modified.html (0 => 277408)


--- trunk/LayoutTests/http/wpt/misc/no-last-modified.html	                        (rev 0)
+++ trunk/LayoutTests/http/wpt/misc/no-last-modified.html	2021-05-12 23:24:22 UTC (rev 277408)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Last-Modified - No Date</title>
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<h1>Last-Modified: No Date</h1>
+<div id="log"></div>
+<script>
+promise_test(async () => {
+    let actual = await getLastModified("");
+    assert_approx_equals((new Date(Date.parse(actual))).getTime(), (new Date()).getTime(), 1000*60);
+}, "Last-Modified sent with no date");
+</script>
+</body>
+</html>
Property changes on: trunk/LayoutTests/http/wpt/misc/no-last-modified.html
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Added: trunk/LayoutTests/http/wpt/misc/resources/last-modified-utilities.js (0 => 277408)


--- trunk/LayoutTests/http/wpt/misc/resources/last-modified-utilities.js	                        (rev 0)
+++ trunk/LayoutTests/http/wpt/misc/resources/last-modified-utilities.js	2021-05-12 23:24:22 UTC (rev 277408)
@@ -0,0 +1,14 @@
+async function getLastModified(header_value) {
+    const iframe = document.createElement("iframe");
+    document.body.appendChild(iframe);
+    try { 
+        const load_promise = new Promise((resolve, reject) => {
+            iframe.addEventListener('load', resolve);
+        });
+        iframe.src = "" + encodeURIComponent(header_value).replace("%2C", "\\,") + ")";
+        await load_promise;
+        return iframe.contentDocument.lastModified;
+    } finally {
+        iframe.remove();
+    }
+}
Property changes on: trunk/LayoutTests/http/wpt/misc/resources/last-modified-utilities.js
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Modified: trunk/LayoutTests/platform/win/TestExpectations (277407 => 277408)


--- trunk/LayoutTests/platform/win/TestExpectations	2021-05-12 23:22:58 UTC (rev 277407)
+++ trunk/LayoutTests/platform/win/TestExpectations	2021-05-12 23:24:22 UTC (rev 277408)
@@ -4407,7 +4407,8 @@
 
 webkit.org/b/209426 http/wpt/css/css-animations/start-animation-001.html  [ Pass Failure ]
 
-webkit.org/b/209455 http/tests/misc/last-modified-parsing.html [ Failure ]
+webkit.org/b/209455 http/wpt/misc/last-modified-parsing.html [ Failure ]
+webkit.org/b/209455 http/wpt/misc/no-last-modified.html [ Failure ]
 
 webkit.org/b/209583 webanimations/no-scheduling-while-filling-accelerated.html [ Skip ]
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to