summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-lastModified-01.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-lastModified-01.html')
-rw-r--r--testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-lastModified-01.html25
1 files changed, 25 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-lastModified-01.html b/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-lastModified-01.html
new file mode 100644
index 0000000000..81f67390d1
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-lastModified-01.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<title>document.lastModified should return current local time</title>
+<meta name="timeout" content="long">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support/document-lastModified-utils.js"></script>
+<div id="log"></div>
+<script>
+ var last_modified = document.lastModified;
+
+ test(function() {
+ assert_regexp_match(last_modified, DOCUMENT_LASTMODIFIED_REGEX,
+ "Format should match the pattern \"NN/NN/NNNN NN:NN:NN\".");
+ }, "Date returned by lastModified is in the form \"MM/DD/YYYY hh:mm:ss\".");
+
+ test(function() {
+ assert_document_lastmodified_string_approximately_now(last_modified);
+ }, "Date returned by lastModified is current at page load");
+
+ var t = async_test("Date returned by lastModified is current after timeout.");
+ t.step_timeout(function() {
+ assert_document_lastmodified_string_approximately_now(document.lastModified);
+ t.done();
+ }, 4000);
+</script>