Changeset 275332 in webkit


Ignore:
Timestamp:
Mar 31, 2021 6:16:50 PM (3 years ago)
Author:
Chris Gambrell
Message:

[LayoutTests] Convert http/tests/appcache convert PHP to Python
https://bugs.webkit.org/show_bug.cgi?id=221286
<rdar://problem/73893844>

Reviewed by Jonathan Bedard.

  • TestExpectations:
  • http/tests/appcache/404-resource-with-slow-main-resource.php: Removed.
  • http/tests/appcache/404-resource-with-slow-main-resource.py: Added.
  • http/tests/appcache/abort-cache-onchecking-manifest-404.html:
  • http/tests/appcache/abort-cache-onchecking.html:
  • http/tests/appcache/access-via-redirect.php: Removed.
  • http/tests/appcache/access-via-redirect.py: Added.
  • http/tests/appcache/auth.html:
  • http/tests/appcache/document-cookie-http-only.php: Removed.
  • http/tests/appcache/document-cookie-http-only.py: Added.
  • http/tests/appcache/document-cookie.php: Removed.
  • http/tests/appcache/document-cookie.py: Added.
  • http/tests/appcache/fail-on-update-2.html:
  • http/tests/appcache/fail-on-update.html:
  • http/tests/appcache/fallback.html:
  • http/tests/appcache/identifier-test.html:
  • http/tests/appcache/main-resource-redirect.html:
  • http/tests/appcache/manifest-redirect-2.html:
  • http/tests/appcache/manifest-redirect.html:
  • http/tests/appcache/online-whitelist.html:
  • http/tests/appcache/remove-cache.html:
  • http/tests/appcache/resource-redirect-2-expected.txt:
  • http/tests/appcache/resource-redirect-expected.txt:
  • http/tests/appcache/resources/abort-cache-onchecking-resource-404.manifest:
  • http/tests/appcache/resources/abort-cache-onchecking.manifest.php: Removed.
  • http/tests/appcache/resources/abort-cache-onchecking.manifest.py: Added.
  • http/tests/appcache/resources/abort-cache-ondownloading.manifest:
  • http/tests/appcache/resources/abort-cache-ondownloading.text.php: Removed.
  • http/tests/appcache/resources/abort-cache-ondownloading.text.py: Added.
  • http/tests/appcache/resources/abort-cache-onprogress.manifest:
  • http/tests/appcache/resources/access-via-redirect.html:
  • http/tests/appcache/resources/appcache-cookies-test.html:
  • http/tests/appcache/resources/auth/iframe.php: Removed.
  • http/tests/appcache/resources/auth/iframe.py: Added.
  • http/tests/appcache/resources/auth/manifest.php: Removed.
  • http/tests/appcache/resources/auth/manifest.py: Added.
  • http/tests/appcache/resources/auth/setup.php: Removed.
  • http/tests/appcache/resources/auth/setup.py: Added.
  • http/tests/appcache/resources/auth/subresource.php: Removed.
  • http/tests/appcache/resources/auth/subresource.py: Added.
  • http/tests/appcache/resources/cookie-protected-script.php: Removed.
  • http/tests/appcache/resources/cookie-protected-script.py: Added.
  • http/tests/appcache/resources/document-cookie.manifest:
  • http/tests/appcache/resources/fail-on-update-2.html:
  • http/tests/appcache/resources/fail-on-update-2.php: Removed.
  • http/tests/appcache/resources/fail-on-update-2.py: Added.
  • http/tests/appcache/resources/fail-on-update.php: Removed.
  • http/tests/appcache/resources/fail-on-update.py: Added.
  • http/tests/appcache/resources/fallback-redirect.php: Removed.
  • http/tests/appcache/resources/fallback-redirect.py: Added.
  • http/tests/appcache/resources/identifier-test-real.php: Removed.
  • http/tests/appcache/resources/identifier-test-real.py: Added.
  • http/tests/appcache/resources/identifier-test.php: Removed.
  • http/tests/appcache/resources/identifier-test.py: Added.
  • http/tests/appcache/resources/intercept/.htaccess:
  • http/tests/appcache/resources/main-resource-redirect-frame.php: Removed.
  • http/tests/appcache/resources/main-resource-redirect-frame.py: Added.
  • http/tests/appcache/resources/manifest-if-cookie.php: Removed.
  • http/tests/appcache/resources/manifest-if-cookie.py: Added.
  • http/tests/appcache/resources/manifest-protected-script.php: Removed.
  • http/tests/appcache/resources/manifest-redirect-2.php: Removed.
  • http/tests/appcache/resources/manifest-redirect-2.py: Added.
  • http/tests/appcache/resources/manifest-redirect.php: Removed.
  • http/tests/appcache/resources/manifest-redirect.py: Added.
  • http/tests/appcache/resources/navigating-away-while-cache-attempt-in-progress.manifest:
  • http/tests/appcache/resources/not-exist.vob.php: Removed.
  • http/tests/appcache/resources/not-exist.vob.py: Added.
  • http/tests/appcache/resources/online-allowlist.manifest:
  • http/tests/appcache/resources/online-allowlist.php: Removed.
  • http/tests/appcache/resources/online-allowlist.py: Added.
  • http/tests/appcache/resources/print-uri.php: Removed.
  • http/tests/appcache/resources/print-uri.py: Added.
  • http/tests/appcache/resources/remove-cache-frame-2.html:
  • http/tests/appcache/resources/remove-cache-frame.html:
  • http/tests/appcache/resources/remove-cache.php: Removed.
  • http/tests/appcache/resources/remove-cache.py: Added.
  • http/tests/appcache/resources/resource-redirect-2.manifest:
  • http/tests/appcache/resources/resource-redirect-2.php: Removed.
  • http/tests/appcache/resources/resource-redirect-2.py: Added.
  • http/tests/appcache/resources/resource-redirect.manifest:
  • http/tests/appcache/resources/resource-redirect.php: Removed.
  • http/tests/appcache/resources/resource-redirect.py: Added.
  • http/tests/appcache/resources/scope1/cookie-protected-manifest.php: Removed.
  • http/tests/appcache/resources/scope1/cookie-protected-manifest.py: Added.
  • http/tests/appcache/resources/scope2/cookie-protected-script.php: Removed.
  • http/tests/appcache/resources/scope2/cookie-protected-script.py: Added.
  • http/tests/appcache/resources/slow-resource.php: Removed.
  • http/tests/appcache/resources/slow-resource.py: Added.
  • http/tests/appcache/resources/uncacheable-resource.php: Removed.
  • http/tests/appcache/resources/uncacheable-resource.py: Added.
  • http/tests/appcache/resources/update-cache.php: Removed.
  • http/tests/appcache/resources/update-cache.py: Added.
  • http/tests/appcache/resources/x-frame-options-prevents-framing-test.html:
  • http/tests/appcache/update-cache.html:
  • http/tests/appcache/x-frame-options-prevents-framing-expected.txt:
  • http/tests/appcache/x-frame-options-prevents-framing.php: Removed.
  • http/tests/appcache/x-frame-options-prevents-framing.py: Added.
  • http/tests/resources/portabilityLayer.py:

(get_count):
(get_state):
(set_state):
(step_state):
(setState): Deleted.
(getState): Deleted.

  • http/tests/xmlhttprequest/resources/access-control-basic-preflight-cache-invalidation.py:
  • http/tests/xmlhttprequest/resources/access-control-basic-preflight-cache-timeout.py:
  • http/tests/xmlhttprequest/resources/access-control-basic-preflight-cache.py:
  • http/tests/xmlhttprequest/resources/access-control-preflight-denied-xsrf.py:
  • http/tests/xmlhttprequest/resources/no-custom-header.py:
  • http/tests/xmlhttprequest/resources/redirect-cross-origin-tripmine.py:
  • http/tests/xmlhttprequest/resources/remember-bad-password/count-failures.py:
  • platform/ios-wk2/TestExpectations:
Location:
trunk/LayoutTests
Files:
28 added
29 deleted
42 edited
4 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r275331 r275332  
     12021-03-31  Chris Gambrell  <cgambrell@apple.com>
     2
     3        [LayoutTests] Convert http/tests/appcache convert PHP to Python
     4        https://bugs.webkit.org/show_bug.cgi?id=221286
     5        <rdar://problem/73893844>
     6
     7        Reviewed by Jonathan Bedard.
     8
     9        * TestExpectations:
     10        * http/tests/appcache/404-resource-with-slow-main-resource.php: Removed.
     11        * http/tests/appcache/404-resource-with-slow-main-resource.py: Added.
     12        * http/tests/appcache/abort-cache-onchecking-manifest-404.html:
     13        * http/tests/appcache/abort-cache-onchecking.html:
     14        * http/tests/appcache/access-via-redirect.php: Removed.
     15        * http/tests/appcache/access-via-redirect.py: Added.
     16        * http/tests/appcache/auth.html:
     17        * http/tests/appcache/document-cookie-http-only.php: Removed.
     18        * http/tests/appcache/document-cookie-http-only.py: Added.
     19        * http/tests/appcache/document-cookie.php: Removed.
     20        * http/tests/appcache/document-cookie.py: Added.
     21        * http/tests/appcache/fail-on-update-2.html:
     22        * http/tests/appcache/fail-on-update.html:
     23        * http/tests/appcache/fallback.html:
     24        * http/tests/appcache/identifier-test.html:
     25        * http/tests/appcache/main-resource-redirect.html:
     26        * http/tests/appcache/manifest-redirect-2.html:
     27        * http/tests/appcache/manifest-redirect.html:
     28        * http/tests/appcache/online-whitelist.html:
     29        * http/tests/appcache/remove-cache.html:
     30        * http/tests/appcache/resource-redirect-2-expected.txt:
     31        * http/tests/appcache/resource-redirect-expected.txt:
     32        * http/tests/appcache/resources/abort-cache-onchecking-resource-404.manifest:
     33        * http/tests/appcache/resources/abort-cache-onchecking.manifest.php: Removed.
     34        * http/tests/appcache/resources/abort-cache-onchecking.manifest.py: Added.
     35        * http/tests/appcache/resources/abort-cache-ondownloading.manifest:
     36        * http/tests/appcache/resources/abort-cache-ondownloading.text.php: Removed.
     37        * http/tests/appcache/resources/abort-cache-ondownloading.text.py: Added.
     38        * http/tests/appcache/resources/abort-cache-onprogress.manifest:
     39        * http/tests/appcache/resources/access-via-redirect.html:
     40        * http/tests/appcache/resources/appcache-cookies-test.html:
     41        * http/tests/appcache/resources/auth/iframe.php: Removed.
     42        * http/tests/appcache/resources/auth/iframe.py: Added.
     43        * http/tests/appcache/resources/auth/manifest.php: Removed.
     44        * http/tests/appcache/resources/auth/manifest.py: Added.
     45        * http/tests/appcache/resources/auth/setup.php: Removed.
     46        * http/tests/appcache/resources/auth/setup.py: Added.
     47        * http/tests/appcache/resources/auth/subresource.php: Removed.
     48        * http/tests/appcache/resources/auth/subresource.py: Added.
     49        * http/tests/appcache/resources/cookie-protected-script.php: Removed.
     50        * http/tests/appcache/resources/cookie-protected-script.py: Added.
     51        * http/tests/appcache/resources/document-cookie.manifest:
     52        * http/tests/appcache/resources/fail-on-update-2.html:
     53        * http/tests/appcache/resources/fail-on-update-2.php: Removed.
     54        * http/tests/appcache/resources/fail-on-update-2.py: Added.
     55        * http/tests/appcache/resources/fail-on-update.php: Removed.
     56        * http/tests/appcache/resources/fail-on-update.py: Added.
     57        * http/tests/appcache/resources/fallback-redirect.php: Removed.
     58        * http/tests/appcache/resources/fallback-redirect.py: Added.
     59        * http/tests/appcache/resources/identifier-test-real.php: Removed.
     60        * http/tests/appcache/resources/identifier-test-real.py: Added.
     61        * http/tests/appcache/resources/identifier-test.php: Removed.
     62        * http/tests/appcache/resources/identifier-test.py: Added.
     63        * http/tests/appcache/resources/intercept/.htaccess:
     64        * http/tests/appcache/resources/main-resource-redirect-frame.php: Removed.
     65        * http/tests/appcache/resources/main-resource-redirect-frame.py: Added.
     66        * http/tests/appcache/resources/manifest-if-cookie.php: Removed.
     67        * http/tests/appcache/resources/manifest-if-cookie.py: Added.
     68        * http/tests/appcache/resources/manifest-protected-script.php: Removed.
     69        * http/tests/appcache/resources/manifest-redirect-2.php: Removed.
     70        * http/tests/appcache/resources/manifest-redirect-2.py: Added.
     71        * http/tests/appcache/resources/manifest-redirect.php: Removed.
     72        * http/tests/appcache/resources/manifest-redirect.py: Added.
     73        * http/tests/appcache/resources/navigating-away-while-cache-attempt-in-progress.manifest:
     74        * http/tests/appcache/resources/not-exist.vob.php: Removed.
     75        * http/tests/appcache/resources/not-exist.vob.py: Added.
     76        * http/tests/appcache/resources/online-allowlist.manifest:
     77        * http/tests/appcache/resources/online-allowlist.php: Removed.
     78        * http/tests/appcache/resources/online-allowlist.py: Added.
     79        * http/tests/appcache/resources/print-uri.php: Removed.
     80        * http/tests/appcache/resources/print-uri.py: Added.
     81        * http/tests/appcache/resources/remove-cache-frame-2.html:
     82        * http/tests/appcache/resources/remove-cache-frame.html:
     83        * http/tests/appcache/resources/remove-cache.php: Removed.
     84        * http/tests/appcache/resources/remove-cache.py: Added.
     85        * http/tests/appcache/resources/resource-redirect-2.manifest:
     86        * http/tests/appcache/resources/resource-redirect-2.php: Removed.
     87        * http/tests/appcache/resources/resource-redirect-2.py: Added.
     88        * http/tests/appcache/resources/resource-redirect.manifest:
     89        * http/tests/appcache/resources/resource-redirect.php: Removed.
     90        * http/tests/appcache/resources/resource-redirect.py: Added.
     91        * http/tests/appcache/resources/scope1/cookie-protected-manifest.php: Removed.
     92        * http/tests/appcache/resources/scope1/cookie-protected-manifest.py: Added.
     93        * http/tests/appcache/resources/scope2/cookie-protected-script.php: Removed.
     94        * http/tests/appcache/resources/scope2/cookie-protected-script.py: Added.
     95        * http/tests/appcache/resources/slow-resource.php: Removed.
     96        * http/tests/appcache/resources/slow-resource.py: Added.
     97        * http/tests/appcache/resources/uncacheable-resource.php: Removed.
     98        * http/tests/appcache/resources/uncacheable-resource.py: Added.
     99        * http/tests/appcache/resources/update-cache.php: Removed.
     100        * http/tests/appcache/resources/update-cache.py: Added.
     101        * http/tests/appcache/resources/x-frame-options-prevents-framing-test.html:
     102        * http/tests/appcache/update-cache.html:
     103        * http/tests/appcache/x-frame-options-prevents-framing-expected.txt:
     104        * http/tests/appcache/x-frame-options-prevents-framing.php: Removed.
     105        * http/tests/appcache/x-frame-options-prevents-framing.py: Added.
     106        * http/tests/resources/portabilityLayer.py:
     107        (get_count):
     108        (get_state):
     109        (set_state):
     110        (step_state):
     111        (setState): Deleted.
     112        (getState): Deleted.
     113        * http/tests/xmlhttprequest/resources/access-control-basic-preflight-cache-invalidation.py:
     114        * http/tests/xmlhttprequest/resources/access-control-basic-preflight-cache-timeout.py:
     115        * http/tests/xmlhttprequest/resources/access-control-basic-preflight-cache.py:
     116        * http/tests/xmlhttprequest/resources/access-control-preflight-denied-xsrf.py:
     117        * http/tests/xmlhttprequest/resources/no-custom-header.py:
     118        * http/tests/xmlhttprequest/resources/redirect-cross-origin-tripmine.py:
     119        * http/tests/xmlhttprequest/resources/remember-bad-password/count-failures.py:
     120        * platform/ios-wk2/TestExpectations:
     121
    11222021-03-31  Robert Jenner  <jenner@apple.com>
    2123
  • trunk/LayoutTests/TestExpectations

    r275221 r275332  
    22742274
    22752275http/tests/appcache/remove-cache.html [ DumpJSConsoleLogInStdErr ]
     2276http/tests/appcache/404-resource-with-slow-main-resource.py [ DumpJSConsoleLogInStdErr ]
     2277http/tests/appcache/fail-on-update.html [ DumpJSConsoleLogInStdErr ]
     2278http/tests/appcache/fail-on-update-2.html [ DumpJSConsoleLogInStdErr ]
    22762279
    22772280# PiP tests are only relevant on macOS Sierra and newer.
  • trunk/LayoutTests/http/tests/appcache/404-resource-with-slow-main-resource.py

    • Property svn:executable set to *
    r275331 r275332  
    1 <!-- webkit-test-runner [ dumpJSConsoleLogInStdErr=true ] -->
    2 <html manifest="resources/404-resource.manifest">
     1#!/usr/bin/env python3
     2
     3import sys
     4import time
     5
     6sys.stdout.write('Content-Type: text/html\r\n\r\n')
     7
     8print('''<html manifest="resources/404-resource.manifest">
    39<div>This tests that a manifest that contains a missing file will not crash the browser even if the main resource keeps loading after the error occurs.</div>
    410<div id="result">FAILURE</div>
     
    2329</script>
    2430
    25 <div id="container">
    26 <?php
    27     while (True) {
    28         usleep(200000);
    29         print "<img src='/does-not-exist.png'>\n";
    30         flush();
    31     }
    32 ?>
    33 </div>
    34 </html>
     31<div id="container">''')
     32
     33while True:
     34    time.sleep(0.2)
     35    sys.stdout.write('<img src=\'/does-not-exist.png\'>\n')
     36    sys.stdout.flush()
     37
     38print('''</div>
     39</html>''')
  • trunk/LayoutTests/http/tests/appcache/abort-cache-onchecking-manifest-404.html

    r231605 r275332  
    1 <html manifest="resources/not-exist.vob.php">
     1<html manifest="resources/not-exist.vob.py">
    22<script>
    33if (window.testRunner) {
  • trunk/LayoutTests/http/tests/appcache/abort-cache-onchecking.html

    r228901 r275332  
    1 <html manifest="resources/abort-cache-onchecking.manifest.php">
     1<html manifest="resources/abort-cache-onchecking.manifest.py">
    22<script>
    33if (window.testRunner) {
  • trunk/LayoutTests/http/tests/appcache/auth.html

    r120167 r275332  
    99// Store authentication credentials.
    1010var req = new XMLHttpRequest;
    11 req.open("GET", "resources/auth/setup.php", false, "login", "pasword");
     11req.open("GET", "resources/auth/setup.py", false, "login", "pasword");
    1212req.send();
    1313
    1414var ifr = document.createElement("iframe");
    15 ifr.setAttribute("src", "resources/auth/iframe.php");
     15ifr.setAttribute("src", "resources/auth/iframe.py");
    1616document.body.appendChild(ifr);
    1717
  • trunk/LayoutTests/http/tests/appcache/document-cookie-http-only.py

    • Property svn:executable set to *
    r275331 r275332  
    1 <?php
    2 setcookie("scope", "manifest", 0, "/appcache/resources/scope1", null, null, true);
    3 setcookie("scope", "script", 0, "/appcache/resources/scope2", null, null, true);
    4 setcookie("foo", "bar");
    5 ?>
    6 <html manifest="resources/scope1/cookie-protected-manifest.php">
     1#!/usr/bin/env python3
     2
     3import sys
     4
     5sys.stdout.write(
     6    'Set-Cookie: scope=manifest; path=/appcache/resources/scope1; HttpOnly\r\n'
     7    'Set-Cookie: scope=script; path=/appcache/resources/scope2; HttpOnly\r\n'
     8    'Set-Cookie: foo=bar\r\n'
     9    'Content-Type: text/html\r\n\r\n'
     10)
     11
     12print('''<html manifest="resources/scope1/cookie-protected-manifest.py">
    713
    814<div>This tests that HttpOnly cookies set on the main document are used when accessing resources in the manifest.</div>
     
    2329    var script = document.createElement("script");
    2430    script.type = "text/javascript";
    25     script.src = "./resources/scope2/cookie-protected-script.php";
     31    script.src = "./resources/scope2/cookie-protected-script.py";
    2632    document.getElementsByTagName("head")[0].appendChild(script);
    2733
     
    2935        script = document.createElement("script");
    3036        script.type = "text/javascript";
    31         script.src = "./resources/cookie-protected-script.php";
     37        script.src = "./resources/cookie-protected-script.py";
    3238        document.getElementsByTagName("head")[0].appendChild(script);
    3339    }, 0);
     
    4147applicationCache.addEventListener('cached', cached, false);
    4248</script>
    43 </html>
     49</html>''')
  • trunk/LayoutTests/http/tests/appcache/fail-on-update-2.html

    r241656 r275332  
    1 <!-- webkit-test-runner [ dumpJSConsoleLogInStdErr=true ] -->
    2 <html manifest="resources/fail-on-update-2.php">
     1<html manifest="resources/fail-on-update-2.py">
    32<script>
    43if (window.testRunner) {
     
    109{
    1110    var req = new XMLHttpRequest;
    12     req.open("GET", "resources/fail-on-update-2.php?command=" + (state ? "delete" : "reset"), false);
     11    req.open("GET", "resources/fail-on-update-2.py?command=" + (state ? "delete" : "reset"), false);
    1312    req.send(null);
    1413}
  • trunk/LayoutTests/http/tests/appcache/fail-on-update.html

    r241656 r275332  
    1 <!-- webkit-test-runner [ dumpJSConsoleLogInStdErr=true ] -->
    2 <html manifest="resources/fail-on-update.php">
     1<html manifest="resources/fail-on-update.py">
    32<script>
    43if (window.testRunner) {
     
    109{
    1110    var req = new XMLHttpRequest;
    12     req.open("GET", "resources/fail-on-update.php?command=" + (state ? "delete" : "reset"), false);
     11    req.open("GET", "resources/fail-on-update.py?command=" + (state ? "delete" : "reset"), false);
    1312    req.send(null);
    1413}
  • trunk/LayoutTests/http/tests/appcache/fallback.html

    r175841 r275332  
    4646var testURL = "/resources/network-simulator.php?test=appcache-fallback&path=/appcache/resources/not-in-cache.txt";
    4747var nonexistentURL = "resources/does-not-exist";
    48 var redirectURL = "resources/fallback-redirect.php";
     48var redirectURL = "resources/fallback-redirect.py";
    4949
    5050function test()
  • trunk/LayoutTests/http/tests/appcache/identifier-test.html

    r187752 r275332  
    1616    }
    1717
    18     window.open("http://localhost:8000/appcache/resources/identifier-test.php", "_blank");
     18    window.open("http://localhost:8000/appcache/resources/identifier-test.py", "_blank");
    1919}
    2020
    2121window.addEventListener("message", receiveMessage, false);
    2222
    23 window.open("http://localhost:8000/appcache/resources/identifier-test-real.php", "_blank");
     23window.open("http://localhost:8000/appcache/resources/identifier-test-real.py", "_blank");
    2424
    2525</script>
  • trunk/LayoutTests/http/tests/appcache/main-resource-redirect.html

    r175841 r275332  
    2222    setNetworkEnabled(false);
    2323    var ifr = document.createElement("iframe");
    24     ifr.setAttribute("src", "resources/main-resource-redirect-frame.php");
     24    ifr.setAttribute("src", "resources/main-resource-redirect-frame.py");
    2525    document.body.appendChild(ifr);
    2626}
  • trunk/LayoutTests/http/tests/appcache/manifest-redirect-2.html

    r120167 r275332  
    1 <html manifest="resources/manifest-redirect-2.php">
     1<html manifest="resources/manifest-redirect-2.py">
    22<body>
    33<p>Test that a redirect makes resource caching fail.</p>
  • trunk/LayoutTests/http/tests/appcache/manifest-redirect.html

    r120167 r275332  
    1 <html manifest="resources/manifest-redirect.php">
     1<html manifest="resources/manifest-redirect.py">
    22<body>
    33<p>Test that a redirect makes resource caching fail.</p>
  • trunk/LayoutTests/http/tests/appcache/online-whitelist.html

    r271043 r275332  
    4444function test()
    4545{
    46     if (load("resources/online-allowlist.php?cached") != load("resources/online-allowlist.php?cached")) {
     46    if (load("resources/online-allowlist.py?cached") != load("resources/online-allowlist.py?cached")) {
    4747        log("FAIL: Explicit entry didn't override online allowlist.");
    4848        hadError = true;
    4949    }
    5050
    51     if (load("resources/online-allowlist.php?uncached") == load("resources/online-allowlist.php?uncached")) {
     51    if (load("resources/online-allowlist.py?uncached") == load("resources/online-allowlist.py?uncached")) {
    5252        log("FAIL: Online allowlist resource wasn't reloaded from network.");
    5353        hadError = true;
    5454    }
    5555
    56     if (load("resources/online-allowlist.php?uncachedxxx") == load("resources/online-allowlist.php?uncachedxxx")) {
     56    if (load("resources/online-allowlist.py?uncachedxxx") == load("resources/online-allowlist.py?uncachedxxx")) {
    5757        log("FAIL: Online allowlist resource wasn't reloaded from network (prefix matching).");
    5858        hadError = true;
    5959    }
    6060
    61     if (canLoad("resources/online-allowlist.php?foobar")) {
     61    if (canLoad("resources/online-allowlist.py?foobar")) {
    6262        log("FAIL: Uncached resource was successfully loaded.");
    6363        hadError = true;
  • trunk/LayoutTests/http/tests/appcache/remove-cache.html

    r175841 r275332  
    1 <html manifest="resources/remove-cache.php">
     1<html manifest="resources/remove-cache.py">
    22<p>Test that a 404 response for manifest results in cache removal.</p>
    33<body>
     
    2525{
    2626    var req = new XMLHttpRequest;
    27     req.open("GET", "resources/remove-cache.php?command=" + (state ? "delete" : "reset"), false);
     27    req.open("GET", "resources/remove-cache.py?command=" + (state ? "delete" : "reset"), false);
    2828    req.send(null);
    2929}
  • trunk/LayoutTests/http/tests/appcache/resource-redirect-2-expected.txt

    r259900 r275332  
    11CONSOLE MESSAGE: ApplicationCache is deprecated. Please use ServiceWorkers instead.
    2 CONSOLE MESSAGE: Application Cache update failed, because http://127.0.0.1:8000/appcache/resources/resource-redirect-2.php was redirected.
     2CONSOLE MESSAGE: Application Cache update failed, because http://127.0.0.1:8000/appcache/resources/resource-redirect-2.py was redirected.
    33Test that a redirect makes resource caching fail.
    44
  • trunk/LayoutTests/http/tests/appcache/resource-redirect-expected.txt

    r259900 r275332  
    11CONSOLE MESSAGE: ApplicationCache is deprecated. Please use ServiceWorkers instead.
    2 CONSOLE MESSAGE: Application Cache update failed, because http://127.0.0.1:8000/appcache/resources/resource-redirect.php was redirected.
     2CONSOLE MESSAGE: Application Cache update failed, because http://127.0.0.1:8000/appcache/resources/resource-redirect.py was redirected.
    33Test that a redirect makes resource caching fail.
    44
  • trunk/LayoutTests/http/tests/appcache/resources/abort-cache-onchecking-resource-404.manifest

    r228901 r275332  
    11CACHE MANIFEST
    2 not-exist.vob.php
     2not-exist.vob.py
  • trunk/LayoutTests/http/tests/appcache/resources/abort-cache-ondownloading.manifest

    r228901 r275332  
    11CACHE MANIFEST
    2 abort-cache-ondownloading.text.php
     2abort-cache-ondownloading.text.py
  • trunk/LayoutTests/http/tests/appcache/resources/abort-cache-onprogress.manifest

    r231574 r275332  
    33abort-cache-onprogress-2.text
    44abort-cache-onprogress-3.text
    5 slow-resource.php
     5slow-resource.py
  • trunk/LayoutTests/http/tests/appcache/resources/access-via-redirect.html

    r120167 r275332  
    2424function cached()
    2525{
    26     if (canLoad("/appcache/access-via-redirect.php")) {
     26    if (canLoad("/appcache/access-via-redirect.py")) {
    2727        document.getElementById('result').innerHTML = "FAILURE: Start of redirect chain is in cache."
    2828        return;
  • trunk/LayoutTests/http/tests/appcache/resources/appcache-cookies-test.html

    r229691 r275332  
    1 <html manifest="manifest-if-cookie.php">
     1<html manifest="manifest-if-cookie.py">
    22<script>
    33function cached()
  • trunk/LayoutTests/http/tests/appcache/resources/document-cookie.manifest

    r229733 r275332  
    11CACHE MANIFEST
    2 /appcache/resources/cookie-protected-script.php
     2/appcache/resources/cookie-protected-script.py
    33NETWORK:
    44/favicon.ico
  • trunk/LayoutTests/http/tests/appcache/resources/fail-on-update-2.html

    r69048 r275332  
    1 <html manifest="fail-on-update-2.php">
     1<html manifest="fail-on-update-2.py">
    22<body>
    33<script>
  • trunk/LayoutTests/http/tests/appcache/resources/identifier-test-real.py

    • Property svn:executable set to *
    r275331 r275332  
    1 <?php
    2     header('X-Frame-Options: SAMEORIGIN');
    3 ?>
     1#!/usr/bin/env python3
    42
    5 <html manifest="identifier-test.manifest">
     3import sys
     4
     5sys.stdout.write(
     6    'X-Frame-Options: SAMEORIGIN\r\n'
     7    'Content-Type: text/html\r\n\r\n'
     8)
     9
     10print('''<html manifest="identifier-test.manifest">
    611<script>
    712
     
    2025
    2126</script>
    22 </html>
     27</html>''')
  • trunk/LayoutTests/http/tests/appcache/resources/intercept/.htaccess

    r39883 r275332  
    11RewriteEngine on
    2 RewriteRule ^.* /appcache/resources/print-uri.php [L,NS]
     2RewriteRule ^.* /appcache/resources/print-uri.py [L,NS]
  • trunk/LayoutTests/http/tests/appcache/resources/navigating-away-while-cache-attempt-in-progress.manifest

    r33378 r275332  
    11CACHE MANIFEST
    2 slow-resource.php
     2slow-resource.py
  • trunk/LayoutTests/http/tests/appcache/resources/online-allowlist.manifest

    r271043 r275332  
    11CACHE MANIFEST
    2 online-allowlist.php?cached
     2online-allowlist.py?cached
    33
    44NETWORK:
     
    99
    1010# This should be ignored, because explicit entries are checked before online allowlist
    11 online-allowlist.php?cached
     11online-allowlist.py?cached
    1212
    1313# This should work normally.
    14 online-allowlist.php?uncached
     14online-allowlist.py?uncached
  • trunk/LayoutTests/http/tests/appcache/resources/remove-cache-frame-2.html

    r175841 r275332  
    1 <html manifest="remove-cache.php">
     1<html manifest="remove-cache.py">
    22<body>
    33<div id=result></div>
  • trunk/LayoutTests/http/tests/appcache/resources/remove-cache-frame.html

    r175841 r275332  
    1 <html manifest="remove-cache.php">
     1<html manifest="remove-cache.py">
    22<body>
    33<div id=result></div>
  • trunk/LayoutTests/http/tests/appcache/resources/resource-redirect-2.manifest

    r40368 r275332  
    11CACHE MANIFEST
    2 resource-redirect-2.php
     2resource-redirect-2.py
  • trunk/LayoutTests/http/tests/appcache/resources/resource-redirect.manifest

    r40356 r275332  
    11CACHE MANIFEST
    2 resource-redirect.php
     2resource-redirect.py
  • trunk/LayoutTests/http/tests/appcache/resources/x-frame-options-prevents-framing-test.html

    r207162 r275332  
    1212The following iframe is a document that was cached in the application cache.<br>
    1313It also had "x-frame-options: deny" set, so it should not actually show up in the iframe<br>
    14 <iframe src="http://127.0.0.1:8000/appcache/x-frame-options-prevents-framing.php"></iframe>
     14<iframe src="http://127.0.0.1:8000/appcache/x-frame-options-prevents-framing.py"></iframe>
  • trunk/LayoutTests/http/tests/appcache/update-cache.html

    r175841 r275332  
    1 <html manifest="resources/update-cache.php">
     1<html manifest="resources/update-cache.py">
    22<body>
    33<p>Test a simple offline application self-update process. Should print a series of messages followed with DONE:</p>
     
    1818{
    1919    var req = new XMLHttpRequest;
    20     req.open("GET", "resources/update-cache.php?command=step", false);
     20    req.open("GET", "resources/update-cache.py?command=step", false);
    2121    req.send(false);
    2222}
  • trunk/LayoutTests/http/tests/appcache/x-frame-options-prevents-framing-expected.txt

    r259900 r275332  
    11CONSOLE MESSAGE: ApplicationCache is deprecated. Please use ServiceWorkers instead.
    2 CONSOLE MESSAGE: Refused to display 'http://127.0.0.1:8000/appcache/x-frame-options-prevents-framing.php' in a frame because it set 'X-Frame-Options' to 'deny'.
     2CONSOLE MESSAGE: Refused to display 'http://127.0.0.1:8000/appcache/x-frame-options-prevents-framing.py' in a frame because it set 'X-Frame-Options' to 'deny'.
    33The following iframe is a document that was cached in the application cache.
    44It also had "x-frame-options: deny" set, so it should not actually show up in the iframe
  • trunk/LayoutTests/http/tests/appcache/x-frame-options-prevents-framing.py

    • Property svn:executable set to *
    r275331 r275332  
    1 <?php
    2 header("X-FRAME-OPTIONS: deny");
    3 ?>
    4 <html manifest="resources/x-frame-options-prevents-framing.manifest">
     1#!/usr/bin/env python3
     2
     3import sys
     4
     5sys.stdout.write(
     6    'X-FRAME-OPTIONS: deny\r\n'
     7    'Content-Type: text/html\r\n\r\n'
     8)
     9
     10print('''<html manifest="resources/x-frame-options-prevents-framing.manifest">
    511<script>
    612
     
    2026This document should not be frameable.<br>
    2127If you see this text in an iframe, then there is a bug.<br>
    22 </html>
     28</html>''')
  • trunk/LayoutTests/http/tests/resources/portabilityLayer.py

    r275315 r275332  
    3535    return cookies
    3636
    37 def setState(state, file):
     37def get_count(file):
     38    if not os.path.isfile(file):
     39        with open(file, 'w') as open_file:
     40            open_file.write('0')
     41            return '0'
     42
     43    with open(file, 'r') as open_file:
     44        return open_file.read()
     45
     46def get_state(file, default='Uninitialized'):
     47    if not os.path.isfile(file):
     48        return default
     49    with open(file, 'r') as file:
     50        return file.read()
     51
     52def set_state(state, file):
    3853    with open(file, 'w') as file:
    3954        file.write(state)
    4055    return state
    4156
    42 
    43 def getState(file, default='Uninitialized'):
    44     if not os.path.isfile(file):
    45         return default
    46     with open(file, 'r') as file:
    47         return file.read()
     57def step_state(file):
     58    state = get_count(file)
     59    with open(file, 'w') as open_file:
     60        open_file.write(f'{int(state) + 1}')
     61    return state
  • trunk/LayoutTests/http/tests/xmlhttprequest/resources/access-control-basic-preflight-cache-invalidation.py

    r272548 r275332  
    88sys.path.insert(0, http_root)
    99
    10 from resources.portabilityLayer import setState, getState
     10from resources.portabilityLayer import set_state, get_state
    1111from urllib.parse import parse_qs
    1212
     
    2525query = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True)
    2626stateFile = os.path.join(tempfile.gettempdir(), query.get('filename', ['state.txt'])[0])
    27 state = getState(stateFile)
     27state = get_state(stateFile)
    2828
    2929sys.stdout.write('Content-Type: text/html\r\n')
     
    3737            '\r\n'
    3838        )
    39         setState('OptionsSent', stateFile)
     39        set_state('OptionsSent', stateFile)
    4040    else:
    4141        fail()
     
    4949            'PASS: First PUT request.'
    5050        )
    51         setState('FirstPUTSent', stateFile)
     51        set_state('FirstPUTSent', stateFile)
    5252    else:
    5353        fail()
     
    6262            '\r\n'
    6363        )
    64         setState('SecondOPTIONSSent', stateFile)
     64        set_state('SecondOPTIONSSent', stateFile)
    6565    elif os.environ.get('REQUEST_METHOD') == 'PUT':
    6666        sys.stdout.write(
  • trunk/LayoutTests/http/tests/xmlhttprequest/resources/access-control-basic-preflight-cache-timeout.py

    r272548 r275332  
    88sys.path.insert(0, http_root)
    99
    10 from resources.portabilityLayer import setState, getState
     10from resources.portabilityLayer import set_state, get_state
    1111from urllib.parse import parse_qs
    1212
     
    2525query = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True)
    2626stateFile = os.path.join(tempfile.gettempdir(), query.get('filename', ['state.txt'])[0])
    27 state = getState(stateFile)
     27state = get_state(stateFile)
    2828
    2929sys.stdout.write('Content-Type: text/html\r\n')
     
    3838            '\r\n'
    3939        )
    40         setState('OptionsSent', stateFile)
     40        set_state('OptionsSent', stateFile)
    4141    else:
    4242        fail()
     
    5050            'PASS: First PUT request.'
    5151        )
    52         setState('FirstPUTSent', stateFile)
     52        set_state('FirstPUTSent', stateFile)
    5353    else:
    5454        fail()
     
    6464            '\r\n'
    6565        )
    66         setState('SecondOPTIONSSent', stateFile)
     66        set_state('SecondOPTIONSSent', stateFile)
    6767    elif os.environ.get('REQUEST_METHOD') == 'PUT':
    6868        sys.stdout.write(
  • trunk/LayoutTests/http/tests/xmlhttprequest/resources/access-control-basic-preflight-cache.py

    r272548 r275332  
    88sys.path.insert(0, http_root)
    99
    10 from resources.portabilityLayer import setState, getState
     10from resources.portabilityLayer import set_state, get_state
    1111from urllib.parse import parse_qs
    1212
     
    2525query = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True)
    2626stateFile = os.path.join(tempfile.gettempdir(), query.get('filename', ['state.txt'])[0])
    27 state = getState(stateFile)
     27state = get_state(stateFile)
    2828
    2929sys.stdout.write('Content-Type: text/html\r\n')
     
    3838            '\r\n'
    3939        )
    40         setState('OptionsSent', stateFile)
     40        set_state('OptionsSent', stateFile)
    4141    else:
    4242        fail()
     
    5050            'PASS: First PUT request.'
    5151        )
    52         setState('FirstPUTSent', stateFile)
     52        set_state('FirstPUTSent', stateFile)
    5353    else:
    5454        fail()
     
    7070            '\r\n'
    7171        )
    72         setState('FAILSecondOPTIONSSent', stateFile)
     72        set_state('FAILSecondOPTIONSSent', stateFile)
    7373    else:
    7474        fail()
  • trunk/LayoutTests/http/tests/xmlhttprequest/resources/access-control-preflight-denied-xsrf.py

    r272548 r275332  
    88sys.path.insert(0, http_root)
    99
    10 from resources.portabilityLayer import setState, getState
     10from resources.portabilityLayer import set_state, get_state
    1111from urllib.parse import parse_qs
    1212
     
    2727query = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True)
    2828stateFile = os.path.join(tempfile.gettempdir(), query.get('test', ['state.txt'])[0])
    29 state = getState(stateFile)
     29state = get_state(stateFile)
    3030stateArg = query.get('state', [None])[0]
    3131
     
    5454            'FAIL: This request should not be displayed\n'
    5555        )
    56         setState('Denied', stateFile)
     56        set_state('Denied', stateFile)
    5757    else:
    5858        fail(state)
     
    6868        )
    6969    else:
    70         setState('Deny Ignored', stateFile)
     70        set_state('Deny Ignored', stateFile)
    7171        fail(state)
    7272
  • trunk/LayoutTests/http/tests/xmlhttprequest/resources/no-custom-header.py

    r272548 r275332  
    88sys.path.insert(0, http_root)
    99
    10 from resources.portabilityLayer import setState, getState
     10from resources.portabilityLayer import set_state, get_state
    1111from urllib.parse import parse_qs
    1212
     
    2424if os.environ.get('REQUEST_METHOD') == 'OPTIONS':
    2525    if os.environ.get('HTTP_X_CUSTOM_HEADER'):
    26         setState('FAIL', stateFile)
     26        set_state('FAIL', stateFile)
    2727    else:
    28         setState('PASS', stateFile)
     28        set_state('PASS', stateFile)
    2929else:
    3030    if os.environ.get('HTTP_X_CUSTOM_HEADER'):
    31         sys.stdout.write(getState(stateFile, default='FAIL'))
     31        sys.stdout.write(get_state(stateFile, default='FAIL'))
    3232    else:
    3333        sys.stdout.write('FAIL - no header in actual request')
  • trunk/LayoutTests/http/tests/xmlhttprequest/resources/redirect-cross-origin-tripmine.py

    r272548 r275332  
    99sys.path.insert(0, http_root)
    1010
    11 from resources.portabilityLayer import setState, getState
     11from resources.portabilityLayer import set_state, get_state
    1212from urllib.parse import parse_qs
    1313
     
    2626if command:
    2727    if command == 'status':
    28         sys.stdout.write(getState(stateFile, default=''))
     28        sys.stdout.write(get_state(stateFile, default=''))
    2929    sys.exit(0)
    3030
     
    3838# Only allow simple cross-site requests - since we did not allow preflight, this is all we should ever get.
    3939if method not in ['GET', 'HEAD', 'POST']:
    40     setState('FAIL. Non-simple method {}.'.format(method), stateFile)
     40    set_state('FAIL. Non-simple method {}.'.format(method), stateFile)
    4141    sys.exit(0)
    4242
     
    4444    and not re.match(r'^multipart\/form\-data(;.+)?$', contentType) \
    4545    and not re.match(r'^text\/plain(;.+)?$', contentType):
    46     setState('FAIL. Non-simple content type: {}.'.format(contentType), stateFile)
     46    set_state('FAIL. Non-simple content type: {}.'.format(contentType), stateFile)
    4747
    4848if os.environ.get('HTTP_X_WEBKIT_TEST'):
    49     setState('FAIL. Custom header sent with a simple request.', stateFile)
     49    set_state('FAIL. Custom header sent with a simple request.', stateFile)
  • trunk/LayoutTests/http/tests/xmlhttprequest/resources/remember-bad-password/count-failures.py

    r272548 r275332  
    99sys.path.insert(0, http_root)
    1010
    11 from resources.portabilityLayer import setState, getState
     11from resources.portabilityLayer import set_state, get_state
    1212from urllib.parse import parse_qs
    1313
     
    3535    sys.stdout.write('\n')
    3636    if command == 'status':
    37         sys.stdout.write(getState(stateFile, default='0'))
     37        sys.stdout.write(get_state(stateFile, default='0'))
    3838    elif command == 'reset':
    39         sys.stdout.write(setState('0', stateFile))
     39        sys.stdout.write(set_state('0', stateFile))
    4040    sys.exit(0)
    4141
     
    5858    )
    5959    if username:
    60         setState(str(int(getState(stateFile, default='0')) + 1), stateFile)
     60        set_state(str(int(get_state(stateFile, default='0')) + 1), stateFile)
  • trunk/LayoutTests/platform/ios-wk2/TestExpectations

    r275245 r275332  
    10511051webkit.org/b/153380 webarchive/loading/missing-data.html [ Pass Crash ]
    10521052
    1053 webkit.org/b/153503 http/tests/appcache/404-resource-with-slow-main-resource.php [ Pass Failure ]
     1053webkit.org/b/153503 http/tests/appcache/404-resource-with-slow-main-resource.py [ Pass Failure ]
    10541054
    10551055# Uses WK1 TestRunner.setUseDeferredFramLoading
Note: See TracChangeset for help on using the changeset viewer.