<?php
require_once 'portabilityLayer.php';

if (!sys_get_temp_dir()) {
    echo "FAIL: No temp dir was returned.\n";
    exit();
}

$tmpFile = sys_get_temp_dir() . "/" . $_GET['filename'];

$stat = stat($tmpFile);
if (!$stat) {
    echo "FAIL: stat() call failed.\n";
    exit();
}

$mtime = $stat['mtime'] + 1;

if (!touch($tmpFile, $mtime)) {
    echo "FAIL: touch() call failed.\n";
}
?>

<?php
require_once 'portabilityLayer.php';

if (!sys_get_temp_dir()) {
    echo "FAIL: No temp dir was returned.\n";
    exit();
}

$tmpFile = sys_get_temp_dir() . "/" . $_GET['filename'];

$stat = stat($tmpFile);
if (!$stat) {
    echo "FAIL: stat() call failed.\n";
    exit();
}

$mtime = $stat['mtime'] + 2;

if (!touch($tmpFile, $mtime)) {
    echo "FAIL: touch() call failed.\n";
}
?>

Advance mtime by two seconds when touching a temporary file.
Advance mtime by two seconds when touching a temporary file.

In send-sliced-dragged-file.html layout test, an unstable file is
simulated by touching the file being uploaded and advancing its mtime by
one second. An error of around one second may be lost in rounding errors
due to lossy conversions of timestamps between Blink and Chrome. Advance
the mtime by 2 seconds to compensate.

BUG=426465

Review URL: https://codereview.chromium.org/895173002

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@189515 bbb929c8-8fbe-4397-9dbb-9b2b20218538
