Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Unified Diff: LayoutTests/http/tests/misc/last-modified-parsing.html

Issue 394903004: document.lastModified should consider user's local time zone (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Finger crossed Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/http/tests/misc/last-modified-parsing-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/misc/last-modified-parsing.html
diff --git a/LayoutTests/http/tests/misc/last-modified-parsing.html b/LayoutTests/http/tests/misc/last-modified-parsing.html
index e9bd793450755ab0bc5b8812d1c5b9e38d3d020d..73d0ee820172c3854062613486e1ba31dd255e47 100644
--- a/LayoutTests/http/tests/misc/last-modified-parsing.html
+++ b/LayoutTests/http/tests/misc/last-modified-parsing.html
@@ -4,8 +4,25 @@ if (window.testRunner) {
testRunner.dumpChildFramesAsText();
}
+function getExpectedLastModified(lastModified) {
+ var date = new Date(lastModified);
+ if (window.internals) {
+ var offset = date.getTimezoneOffset() * 60 * 1000;
+ var ms = date.getTime() + offset;
+ date = new Date(internals.convertToLocalTime(ms));
tkent 2014/07/24 06:20:05 Did you investigate why local time representation
kangil_ 2014/07/24 11:35:28 After further investigation, I've found that calcu
+ }
+ var month = ("0" + (date.getMonth() + 1)).slice(-2);
+ var day = ("0" + date.getDate()).slice(-2);
+ var hour = ("0" + date.getHours()).slice(-2);
+ var minute = ("0" + date.getMinutes()).slice(-2);
+ var second = ("0" + date.getSeconds()).slice(-2);
+ var result = month + '/' + day + '/' + date.getFullYear() + ' ' + hour + ':' + minute + ':' + second;
+ return result;
+}
+
function test(text) {
- document.write('<iframe src="../resources/last-modified.php?date=' + escape(text) + '"></iframe>');
+ var url = '../resources/last-modified.php?date=' + escape(text) + '&expected=' + escape(getExpectedLastModified(text));
+ document.write('<iframe id="test" src="' + url + '"></iframe>');
}
test('Mon, 21 Nov 2008 01:03:33 GMT');
« no previous file with comments | « no previous file | LayoutTests/http/tests/misc/last-modified-parsing-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698