Changeset 176602 in webkit


Ignore:
Timestamp:
Dec 1, 2014 1:15:42 PM (9 years ago)
Author:
ap@apple.com
Message:

http tests should not use shared temporary files, part 3
https://bugs.webkit.org/show_bug.cgi?id=139135

Reviewed by Tim Horton.

Fix ping tests, using the same techniques as before.

  • http/tests/navigation/image-load-in-unload-handler.html:
  • http/tests/navigation/ping-cross-origin-from-https.html:
  • http/tests/navigation/resources/check-ping.php:
  • http/tests/navigation/resources/delete-ping.php:
  • http/tests/navigation/resources/image-load-in-unload-handler-2.html: Copied from LayoutTests/http/tests/navigation/resources/ping-redirect.html.
  • http/tests/navigation/resources/ping-file-path.php: Copied from LayoutTests/http/tests/security/contentSecurityPolicy/resources/report-file-path.php.
  • http/tests/navigation/resources/ping-redirect.html: Removed.
  • http/tests/navigation/resources/save-Ping.php:
Location:
trunk/LayoutTests
Files:
2 added
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r176600 r176602  
     12014-12-01  Alexey Proskuryakov  <ap@apple.com>
     2
     3        http tests should not use shared temporary files, part 3
     4        https://bugs.webkit.org/show_bug.cgi?id=139135
     5
     6        Reviewed by Tim Horton.
     7
     8        Fix ping tests, using the same techniques as before.
     9
     10        * http/tests/navigation/image-load-in-unload-handler.html:
     11        * http/tests/navigation/ping-cross-origin-from-https.html:
     12        * http/tests/navigation/resources/check-ping.php:
     13        * http/tests/navigation/resources/delete-ping.php:
     14        * http/tests/navigation/resources/image-load-in-unload-handler-2.html: Copied from LayoutTests/http/tests/navigation/resources/ping-redirect.html.
     15        * http/tests/navigation/resources/ping-file-path.php: Copied from LayoutTests/http/tests/security/contentSecurityPolicy/resources/report-file-path.php.
     16        * http/tests/navigation/resources/ping-redirect.html: Removed.
     17        * http/tests/navigation/resources/save-Ping.php:
     18
    1192014-12-01  Alexey Proskuryakov  <ap@apple.com>
    220
  • trunk/LayoutTests/http/tests/navigation/image-load-in-unload-handler.html

    r124692 r176602  
    2020    // to make sure that the onunload handler has run before we get to
    2121    // check-ping.php.
    22     location.assign("resources/ping-redirect.html");
     22    location.assign("resources/image-load-in-unload-handler-2.html");
    2323}
    2424
  • trunk/LayoutTests/http/tests/navigation/ping-cross-origin-from-https.html

    r124692 r176602  
    99
    1010if (location.protocol != "https:")
    11     location = "https://127.0.0.1:8443/navigation/ping-cross-origin.html"
     11    location = "https://127.0.0.1:8443/navigation/ping-cross-origin-from-https.html"
     12
     13var testCalled = false;
     14
     15function test() {
     16    if (!testCalled) {
     17        if (window.testRunner) {
     18            testRunner.dumpAsText();
     19            testRunner.overridePreference("WebKitHyperlinkAuditingEnabled", 1);
     20            testRunner.waitUntilDone();
     21        }
     22        testCalled = true;
     23        return;
     24    }
     25
     26    if (window.eventSender) {
     27        var a = document.getElementById("a");
     28        eventSender.mouseMoveTo(a.offsetLeft + 2, a.offsetTop + 2);
     29        eventSender.mouseDown();
     30        eventSender.mouseUp();
     31    }
     32}
     33
    1234</script>
    13 </head></html>
     35</head>
     36</script>
     37</head>
     38<body onload="test();">
     39<img src="resources/delete-ping.php" onload="test();" onerror="test();"></img>
     40<a id="a" href="resources/check-ping.php" ping="http://localhost:8000/navigation/resources/save-Ping.php?test=/navigation/ping-cross-origin-from-https.html">Navigate and send ping</a>
     41</body></html>
  • trunk/LayoutTests/http/tests/navigation/resources/check-ping.php

    r124691 r176602  
    11<?php
    2 while (!file_exists("ping.txt")) {
     2require_once 'ping-file-path.php';
     3
     4while (!file_exists($pingFilePath)) {
    35    usleep(10000);
    46    // file_exists() caches results, we want to invalidate the cache.
     
    810echo "<html><body>\n";
    911echo "Ping sent successfully";
    10 $pingFile = fopen("ping.txt", 'r');
     12$pingFile = fopen($pingFilePath, 'r');
    1113while ($line = fgets($pingFile)) {
    1214    echo "<br>";
     
    1416}
    1517fclose($pingFile);
    16 unlink("ping.txt");
     18unlink($pingFilePath);
    1719echo "<script>";
    1820echo "if (window.testRunner)";
  • trunk/LayoutTests/http/tests/navigation/resources/delete-ping.php

    r65910 r176602  
    11<?php
    2 unlink("ping.txt");
     2require_once 'ping-file-path.php';
     3
     4unlink($pingFilePath);
    35?>
  • trunk/LayoutTests/http/tests/navigation/resources/save-Ping.php

    r107450 r176602  
    11<?php
    2 $pingFile = fopen("ping.txt.tmp", 'w');
     2require_once 'ping-file-path.php';
     3
     4$pingFile = fopen($pingFilePath . ".tmp", 'w');
    35$httpHeaders = $_SERVER;
    46ksort($httpHeaders, SORT_STRING);
     
    810}
    911fclose($pingFile);
    10 rename("ping.txt.tmp", "ping.txt");
     12rename($pingFilePath . ".tmp", $pingFilePath);
    1113foreach ($_COOKIE as $name => $value)
    1214    setcookie($name, "deleted", time() - 60, "/");
Note: See TracChangeset for help on using the changeset viewer.