Commit 396cf92f authored by Harley Li's avatar Harley Li Committed by Commit Bot

[DevTools] Treat negative cookie expiration date as 'Session'

Bug: 946386
Change-Id: I19951d9824e989947e474786ede85d97515e9b96
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1546728Reviewed-by: default avatarErik Luo <luoe@chromium.org>
Commit-Queue: Haihong Li (Harley) <hhli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#646514}
parent 738ddb30
...@@ -353,7 +353,7 @@ CookieTable.CookiesTable = class extends UI.VBox { ...@@ -353,7 +353,7 @@ CookieTable.CookiesTable = class extends UI.VBox {
data.expires = Number.secondsToString(parseInt(cookie.maxAge(), 10)); data.expires = Number.secondsToString(parseInt(cookie.maxAge(), 10));
} else if (cookie.expires()) { } else if (cookie.expires()) {
if (cookie.expires() < 0) if (cookie.expires() < 0)
data.expires = 'N/A'; data.expires = CookieTable.CookiesTable._expiresSessionValue;
else else
data.expires = new Date(cookie.expires()).toISOString(); data.expires = new Date(cookie.expires()).toISOString();
} else { } else {
......
...@@ -23,13 +23,13 @@ node.appendChild call: cookieB 2 1970-01-01T00:00:00.001Z ...@@ -23,13 +23,13 @@ node.appendChild call: cookieB 2 1970-01-01T00:00:00.001Z
node.appendChild call: cookieC foo 2018-12-17T14:31:30.000Z node.appendChild call: cookieC foo 2018-12-17T14:31:30.000Z
node.appendChild call: cookieD {other} 1970-01-01T05:32:21.213Z node.appendChild call: cookieD {other} 1970-01-01T05:32:21.213Z
node.appendChild call: cookieE zz 1970-01-01T01:42:01.598Z node.appendChild call: cookieE zz 1970-01-01T01:42:01.598Z
node.appendChild call: cookieF null N/A node.appendChild call: cookieF null Session
--- Descending selection test --- --- Descending selection test ---
# of node.appendChild calls: 6 # of node.appendChild calls: 6
# of node.removeChildren calls: 2 # of node.removeChildren calls: 2
node.appendChild call: cookieF null N/A node.appendChild call: cookieF null Session
node.appendChild call: cookieE zz 1970-01-01T01:42:01.598Z node.appendChild call: cookieE zz 1970-01-01T01:42:01.598Z
node.appendChild call: cookieD {other} 1970-01-01T05:32:21.213Z node.appendChild call: cookieD {other} 1970-01-01T05:32:21.213Z
node.appendChild call: cookieC foo 2018-12-17T14:31:30.000Z [selected] node.appendChild call: cookieC foo 2018-12-17T14:31:30.000Z [selected]
...@@ -45,7 +45,7 @@ node.appendChild call: cookieB 2 1970-01-01T00:00:00.001Z ...@@ -45,7 +45,7 @@ node.appendChild call: cookieB 2 1970-01-01T00:00:00.001Z
node.appendChild call: cookieC foo 2018-12-17T14:31:30.000Z node.appendChild call: cookieC foo 2018-12-17T14:31:30.000Z
node.appendChild call: cookieD {other} 1970-01-01T05:32:21.213Z node.appendChild call: cookieD {other} 1970-01-01T05:32:21.213Z
node.appendChild call: cookieE zz 1970-01-01T01:42:01.598Z node.appendChild call: cookieE zz 1970-01-01T01:42:01.598Z
node.appendChild call: cookieF null N/A node.appendChild call: cookieF null Session
--- Previous neighbor selection test --- --- Previous neighbor selection test ---
...@@ -56,7 +56,7 @@ node.appendChild call: cookieB 2 1970-01-01T00:00:00.001Z ...@@ -56,7 +56,7 @@ node.appendChild call: cookieB 2 1970-01-01T00:00:00.001Z
node.appendChild call: cookieC foo 2018-12-17T14:31:30.000Z node.appendChild call: cookieC foo 2018-12-17T14:31:30.000Z
node.appendChild call: cookieD {other} 1970-01-01T05:32:21.213Z node.appendChild call: cookieD {other} 1970-01-01T05:32:21.213Z
node.appendChild call: cookieE zz 1970-01-01T01:42:01.598Z [selected] node.appendChild call: cookieE zz 1970-01-01T01:42:01.598Z [selected]
node.appendChild call: cookieF null N/A node.appendChild call: cookieF null Session
--- Inactive node test --- --- Inactive node test ---
...@@ -67,7 +67,7 @@ node.appendChild call: cookieB 2 1970-01-01T00:00:00.001Z ...@@ -67,7 +67,7 @@ node.appendChild call: cookieB 2 1970-01-01T00:00:00.001Z
node.appendChild call: cookieC foo 2018-12-17T14:31:30.000Z node.appendChild call: cookieC foo 2018-12-17T14:31:30.000Z
node.appendChild call: cookieD {other} 1970-01-01T05:32:21.213Z node.appendChild call: cookieD {other} 1970-01-01T05:32:21.213Z
node.appendChild call: cookieE zz 1970-01-01T01:42:01.598Z node.appendChild call: cookieE zz 1970-01-01T01:42:01.598Z
node.appendChild call: cookieF null N/A node.appendChild call: cookieF null Session
node.appendChild call: missing cookie Session [selected] node.appendChild call: missing cookie Session [selected]
-------- Sort cookies -------- -------- Sort cookies --------
......
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
{name: 'cookieC', value: 'foo', path: '/', domain: 'abc.example.com', expires: 1545057090000}, {name: 'cookieC', value: 'foo', path: '/', domain: 'abc.example.com', expires: 1545057090000},
{name: 'cookieD', value: '{other}', path: '/aa', domain: '.other.com', expires: 19941213}, {name: 'cookieD', value: '{other}', path: '/aa', domain: '.other.com', expires: 19941213},
{name: 'cookieE', value: 'zz', path: '/gg', domain: 'z.example.com', expires: 6121598}, {name: 'cookieE', value: 'zz', path: '/gg', domain: 'z.example.com', expires: 6121598},
{name: 'cookieF', value: 'null', path: '/', domain: 'example.com', expires: -1000}, {name: 'cookieF', value: 'null', path: '/', domain: 'example.com', expires: -1},
]; ];
TestRunner.addResult('\n-------- RebuildTable --------\n'); TestRunner.addResult('\n-------- RebuildTable --------\n');
testRebuildTable(cookieData); testRebuildTable(cookieData);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment