tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

document-lastModified-01.html (1010B)


      1 <!DOCTYPE html>
      2 <title>document.lastModified should return current local time</title>
      3 <meta name="timeout" content="long">
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script src="support/document-lastModified-utils.js"></script>
      7 <div id="log"></div>
      8 <script>
      9  var last_modified = document.lastModified;
     10 
     11  test(function() {
     12     assert_regexp_match(last_modified, DOCUMENT_LASTMODIFIED_REGEX,
     13                         "Format should match the pattern \"NN/NN/NNNN NN:NN:NN\".");
     14  }, "Date returned by lastModified is in the form \"MM/DD/YYYY hh:mm:ss\".");
     15 
     16  test(function() {
     17    assert_document_lastmodified_string_approximately_now(last_modified);
     18  }, "Date returned by lastModified is current at page load");
     19 
     20  var t = async_test("Date returned by lastModified is current after timeout.");
     21  t.step_timeout(function() {
     22    assert_document_lastmodified_string_approximately_now(document.lastModified);
     23    t.done();
     24  }, 4000);
     25 </script>