Skip to content

Commit 494b081

Browse files
committed
[LayoutTests] Convert http/tests/navigation convert PHP to Python
https://bugs.webkit.org/show_bug.cgi?id=222418 <rdar://problem/74744523> Reviewed by Jonathan Bedard. * http/tests/blink/sendbeacon/beacon-cross-origin-redirect-blob-expected.txt: * http/tests/blink/sendbeacon/beacon-cross-origin-redirect-blob.html: * http/tests/blink/sendbeacon/beacon-cross-origin-redirect-expected.txt: * http/tests/blink/sendbeacon/beacon-cross-origin-redirect.html: * http/tests/navigation/image-load-in-pagehide-handler-expected.txt: * http/tests/navigation/image-load-in-pagehide-handler.html: * http/tests/navigation/image-load-in-unload-handler-expected.txt: * http/tests/navigation/image-load-in-unload-handler.html: * http/tests/navigation/no-referrer-reset-expected.txt: * http/tests/navigation/no-referrer-reset.html: * http/tests/navigation/no-referrer-same-window.html: * http/tests/navigation/no-referrer-subframe.html: * http/tests/navigation/no-referrer-target-blank.html: * http/tests/navigation/ping-attribute/anchor-cookie-expected.txt: * http/tests/navigation/ping-attribute/anchor-cookie.html: * http/tests/navigation/ping-attribute/anchor-cross-origin-expected.txt: * http/tests/navigation/ping-attribute/anchor-cross-origin-from-https-expected.txt: * http/tests/navigation/ping-attribute/anchor-cross-origin-from-https.html: * http/tests/navigation/ping-attribute/anchor-cross-origin.html: * http/tests/navigation/ping-attribute/anchor-ping-and-follow-redirect-when-sending-ping-expected.txt: * http/tests/navigation/ping-attribute/anchor-ping-and-follow-redirect-when-sending-ping.html: * http/tests/navigation/ping-attribute/anchor-same-origin-expected.txt: * http/tests/navigation/ping-attribute/anchor-same-origin.html: * http/tests/navigation/ping-attribute/area-cookie-expected.txt: * http/tests/navigation/ping-attribute/area-cookie.html: * http/tests/navigation/ping-attribute/area-cross-origin-expected.txt: * http/tests/navigation/ping-attribute/area-cross-origin-from-https-expected.txt: * http/tests/navigation/ping-attribute/area-cross-origin-from-https.html: * http/tests/navigation/ping-attribute/area-cross-origin.html: * http/tests/navigation/ping-attribute/area-same-origin-expected.txt: * http/tests/navigation/ping-attribute/area-same-origin.html: * http/tests/navigation/ping-attribute/resources/utilities.js: (clearLastPingResultAndRunTest): * http/tests/navigation/post-301-response.html: * http/tests/navigation/post-302-response.html: * http/tests/navigation/post-303-response.html: * http/tests/navigation/post-307-response.html: * http/tests/navigation/post-308-response.html: * http/tests/navigation/resources/check-ping.php: Removed. * http/tests/navigation/resources/check-ping.py: Added. * http/tests/navigation/resources/delete-ping.php: Removed. * http/tests/navigation/resources/delete-ping.py: Added. * http/tests/navigation/resources/image-load-in-pagehide-handler-2.html: * http/tests/navigation/resources/image-load-in-unload-handler-2.html: * http/tests/navigation/resources/no-referrer-helper.php: Removed. * http/tests/navigation/resources/no-referrer-helper.py: Added. * http/tests/navigation/resources/no-referrer-reset-helper.php: Removed. * http/tests/navigation/resources/no-referrer-reset-helper.py: Added. * http/tests/navigation/resources/no-referrer-same-window-helper.php: Removed. * http/tests/navigation/resources/no-referrer-same-window-helper.py: Added. * http/tests/navigation/resources/ping-file-path.php: Removed. * http/tests/navigation/resources/ping_file_path.py: Added. * http/tests/navigation/resources/redirected-post-request-contents.php: Removed. * http/tests/navigation/resources/redirected-post-request-contents.py: Added. (check_header): * http/tests/navigation/resources/redirection-response.php: Removed. * http/tests/navigation/resources/redirection-response.py: Added. * http/tests/navigation/resources/save-Ping.php: Removed. * http/tests/navigation/resources/save-ping-and-redirect-to-save-ping.php: Removed. * http/tests/navigation/resources/save-ping-and-redirect-to-save-ping.py: Added. * http/tests/navigation/resources/save-ping.py: Added. * http/tests/navigation/resources/save_ping.py: Added. (not_being_called): (save_ping): * http/tests/security/contentSecurityPolicy/1.1/form-action-src-redirect-blocked.html: Canonical link: https://commits.webkit.org/236313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275677 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 007ec30 commit 494b081

59 files changed

Lines changed: 404 additions & 261 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

LayoutTests/ChangeLog

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,77 @@
1+
2021-04-08 Chris Gambrell <cgambrell@apple.com>
2+
3+
[LayoutTests] Convert http/tests/navigation convert PHP to Python
4+
https://bugs.webkit.org/show_bug.cgi?id=222418
5+
<rdar://problem/74744523>
6+
7+
Reviewed by Jonathan Bedard.
8+
9+
* http/tests/blink/sendbeacon/beacon-cross-origin-redirect-blob-expected.txt:
10+
* http/tests/blink/sendbeacon/beacon-cross-origin-redirect-blob.html:
11+
* http/tests/blink/sendbeacon/beacon-cross-origin-redirect-expected.txt:
12+
* http/tests/blink/sendbeacon/beacon-cross-origin-redirect.html:
13+
* http/tests/navigation/image-load-in-pagehide-handler-expected.txt:
14+
* http/tests/navigation/image-load-in-pagehide-handler.html:
15+
* http/tests/navigation/image-load-in-unload-handler-expected.txt:
16+
* http/tests/navigation/image-load-in-unload-handler.html:
17+
* http/tests/navigation/no-referrer-reset-expected.txt:
18+
* http/tests/navigation/no-referrer-reset.html:
19+
* http/tests/navigation/no-referrer-same-window.html:
20+
* http/tests/navigation/no-referrer-subframe.html:
21+
* http/tests/navigation/no-referrer-target-blank.html:
22+
* http/tests/navigation/ping-attribute/anchor-cookie-expected.txt:
23+
* http/tests/navigation/ping-attribute/anchor-cookie.html:
24+
* http/tests/navigation/ping-attribute/anchor-cross-origin-expected.txt:
25+
* http/tests/navigation/ping-attribute/anchor-cross-origin-from-https-expected.txt:
26+
* http/tests/navigation/ping-attribute/anchor-cross-origin-from-https.html:
27+
* http/tests/navigation/ping-attribute/anchor-cross-origin.html:
28+
* http/tests/navigation/ping-attribute/anchor-ping-and-follow-redirect-when-sending-ping-expected.txt:
29+
* http/tests/navigation/ping-attribute/anchor-ping-and-follow-redirect-when-sending-ping.html:
30+
* http/tests/navigation/ping-attribute/anchor-same-origin-expected.txt:
31+
* http/tests/navigation/ping-attribute/anchor-same-origin.html:
32+
* http/tests/navigation/ping-attribute/area-cookie-expected.txt:
33+
* http/tests/navigation/ping-attribute/area-cookie.html:
34+
* http/tests/navigation/ping-attribute/area-cross-origin-expected.txt:
35+
* http/tests/navigation/ping-attribute/area-cross-origin-from-https-expected.txt:
36+
* http/tests/navigation/ping-attribute/area-cross-origin-from-https.html:
37+
* http/tests/navigation/ping-attribute/area-cross-origin.html:
38+
* http/tests/navigation/ping-attribute/area-same-origin-expected.txt:
39+
* http/tests/navigation/ping-attribute/area-same-origin.html:
40+
* http/tests/navigation/ping-attribute/resources/utilities.js:
41+
(clearLastPingResultAndRunTest):
42+
* http/tests/navigation/post-301-response.html:
43+
* http/tests/navigation/post-302-response.html:
44+
* http/tests/navigation/post-303-response.html:
45+
* http/tests/navigation/post-307-response.html:
46+
* http/tests/navigation/post-308-response.html:
47+
* http/tests/navigation/resources/check-ping.php: Removed.
48+
* http/tests/navigation/resources/check-ping.py: Added.
49+
* http/tests/navigation/resources/delete-ping.php: Removed.
50+
* http/tests/navigation/resources/delete-ping.py: Added.
51+
* http/tests/navigation/resources/image-load-in-pagehide-handler-2.html:
52+
* http/tests/navigation/resources/image-load-in-unload-handler-2.html:
53+
* http/tests/navigation/resources/no-referrer-helper.php: Removed.
54+
* http/tests/navigation/resources/no-referrer-helper.py: Added.
55+
* http/tests/navigation/resources/no-referrer-reset-helper.php: Removed.
56+
* http/tests/navigation/resources/no-referrer-reset-helper.py: Added.
57+
* http/tests/navigation/resources/no-referrer-same-window-helper.php: Removed.
58+
* http/tests/navigation/resources/no-referrer-same-window-helper.py: Added.
59+
* http/tests/navigation/resources/ping-file-path.php: Removed.
60+
* http/tests/navigation/resources/ping_file_path.py: Added.
61+
* http/tests/navigation/resources/redirected-post-request-contents.php: Removed.
62+
* http/tests/navigation/resources/redirected-post-request-contents.py: Added.
63+
(check_header):
64+
* http/tests/navigation/resources/redirection-response.php: Removed.
65+
* http/tests/navigation/resources/redirection-response.py: Added.
66+
* http/tests/navigation/resources/save-Ping.php: Removed.
67+
* http/tests/navigation/resources/save-ping-and-redirect-to-save-ping.php: Removed.
68+
* http/tests/navigation/resources/save-ping-and-redirect-to-save-ping.py: Added.
69+
* http/tests/navigation/resources/save-ping.py: Added.
70+
* http/tests/navigation/resources/save_ping.py: Added.
71+
(not_being_called):
72+
(save_ping):
73+
* http/tests/security/contentSecurityPolicy/1.1/form-action-src-redirect-blocked.html:
74+
175
2021-04-08 Chris Gambrell <cgambrell@apple.com>
276

377
[LayoutTests] Convert http/tests/workers convert PHP to Python

LayoutTests/http/tests/blink/sendbeacon/beacon-cross-origin-redirect-blob-expected.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Verifying navigator.sendBeacon(Blob) non-CORS cross-origin redirect handling.
33
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
44

55

6-
PASS navigator.sendBeacon("http://127.0.0.1:8080/navigation/resources/redirection-response.php?status=302&simple=true&target=/non-existent.php", blob); is true
6+
PASS navigator.sendBeacon("http://127.0.0.1:8080/navigation/resources/redirection-response.py?status=302&simple=true&target=/non-existent.php", blob); is true
77
PASS successfullyParsed is true
88

99
TEST COMPLETE

LayoutTests/http/tests/blink/sendbeacon/beacon-cross-origin-redirect-blob.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99

1010
const blob = new Blob(["Cross", "Origin"], {type: "text/plain;from-beacon=true"});
1111
// The "simple" parameter is just for differentiating the URLs.
12-
shouldBeTrue('navigator.sendBeacon("http://127.0.0.1:8080/navigation/resources/redirection-response.php?status=302&simple=true&target=/non-existent.php", blob);');
12+
shouldBeTrue('navigator.sendBeacon("http://127.0.0.1:8080/navigation/resources/redirection-response.py?status=302&simple=true&target=/non-existent.php", blob);');
1313
</script>

LayoutTests/http/tests/blink/sendbeacon/beacon-cross-origin-redirect-expected.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Verifying that navigator.sendBeacon() to non-CORS cross-origin redirect fails.
33
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
44

55

6-
PASS navigator.sendBeacon("http://127.0.0.1:8080/navigation/resources/redirection-response.php?status=302&target=/non-existent.php", "CrossOrigin"); is true
6+
PASS navigator.sendBeacon("http://127.0.0.1:8080/navigation/resources/redirection-response.py?status=302&target=/non-existent.php", "CrossOrigin"); is true
77
PASS successfullyParsed is true
88

99
TEST COMPLETE

LayoutTests/http/tests/blink/sendbeacon/beacon-cross-origin-redirect.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//testRunner.dumpPingLoaderCallbacks();
1414
}
1515

16-
shouldBeTrue('navigator.sendBeacon("http://127.0.0.1:8080/navigation/resources/redirection-response.php?status=302&target=/non-existent.php", "CrossOrigin");');
16+
shouldBeTrue('navigator.sendBeacon("http://127.0.0.1:8080/navigation/resources/redirection-response.py?status=302&target=/non-existent.php", "CrossOrigin");');
1717
// Wait a while for the redirect response handling to happen before finishing up.
1818
setTimeout(finishJSTest, 200);
1919
}

LayoutTests/http/tests/navigation/image-load-in-pagehide-handler-expected.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ Ping sent successfully
22
HTTP_HOST: 127.0.0.1:8000
33
HTTP_REFERER: http://127.0.0.1:8000/navigation/image-load-in-pagehide-handler.html
44
REQUEST_METHOD: GET
5-
REQUEST_URI: /navigation/resources/save-Ping.php
5+
REQUEST_URI: /navigation/resources/save-ping.py

LayoutTests/http/tests/navigation/image-load-in-pagehide-handler.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919

2020
function ping() {
2121
var img = new Image(1, 1);
22-
img.src = "resources/save-Ping.php";
22+
img.src = "resources/save-ping.py";
2323
}
2424

2525
</script>
2626
</head>
2727
<body onload="test();" onpagehide="ping();">
28-
<img src="resources/delete-ping.php" onload="test();" onerror="test();"></img>
28+
<img src="resources/delete-ping.py" onload="test();" onerror="test();"></img>
2929
<p>Tests that ping loads in 'pagehide' handlers go through.</p>
3030
</body></html>

LayoutTests/http/tests/navigation/image-load-in-unload-handler-expected.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ Ping sent successfully
33
HTTP_HOST: 127.0.0.1:8000
44
HTTP_REFERER: http://127.0.0.1:8000/navigation/image-load-in-unload-handler.html
55
REQUEST_METHOD: GET
6-
REQUEST_URI: /navigation/resources/save-Ping.php
6+
REQUEST_URI: /navigation/resources/save-ping.py

LayoutTests/http/tests/navigation/image-load-in-unload-handler.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,24 @@
1313
testCalled = true;
1414
return;
1515
}
16-
// We can't go to check-ping.php directly, since that doesn't start sending
16+
// We can't go to check-ping.py directly, since that doesn't start sending
1717
// a response until the ping data is detected, but unload handlers (where
1818
// we send the ping) are only run once we've begun receiving data from the
1919
// page being navigated to. Instead, we go through a dummy redirect page,
2020
// to make sure that the onunload handler has run before we get to
21-
// check-ping.php.
21+
// check-ping.py.
2222
location.assign("resources/image-load-in-unload-handler-2.html");
2323
}
2424

2525
function ping() {
2626
var img = new Image(1, 1);
27-
img.src = "resources/save-Ping.php";
27+
img.src = "resources/save-ping.py";
2828
}
2929

3030
</script>
3131
</head>
3232
<body onload="test();" onunload="ping();">
33-
<img src="resources/delete-ping.php" onload="test();" onerror="test();"></img>
33+
<img src="resources/delete-ping.py" onload="test();" onerror="test();"></img>
3434
Test case for https://bugs.webkit.org/show_bug.cgi?id=30457. Previously, if an image<br>
3535
load was trigger from an unload handler, we would kill it almost immediately due to the<br>
3636
navigation stopping all loaders. These loads now happen entirely in the background and detached<br>

LayoutTests/http/tests/navigation/no-referrer-reset-expected.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CONSOLE MESSAGE: Referrer: http://127.0.0.1:8000/navigation/resources/no-referrer-reset-helper.php
1+
CONSOLE MESSAGE: Referrer: http://127.0.0.1:8000/navigation/resources/no-referrer-reset-helper.py
22
CONSOLE MESSAGE: window.opener: http://127.0.0.1:8000/navigation/no-referrer-reset.html
33
This tests whether referrer information gets properly set and reset when "noreferrer" links are present. We do the following:
44
1. Open a link in a new window: referrer is sent and window.opener is sent.

0 commit comments

Comments
 (0)