1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
7 * 1. Adds a new tab (but doesn't select it)
8 * 2. Checks if timestamp on the new tab is 0
9 * 3. Selects the new tab, checks that the timestamp is updated (>0)
10 * 4. Selects the original tab & checks if new tab's timestamp has remained changed
14 let originalTab = gBrowser.selectedTab;
15 let newTab = gBrowser.addTab("about:blank", {skipAnimation: true});
16 is(newTab.lastAccessed, 0, "Timestamp on the new tab is 0.");
17 gBrowser.selectedTab = newTab;
18 let newTabAccessedDate = newTab.lastAccessed;
19 ok(newTabAccessedDate > 0, "Timestamp on the selected tab is more than 0.");
20 ok(newTabAccessedDate <= Date.now(), "Timestamp less than or equal current Date.");
21 gBrowser.selectedTab = originalTab;
22 is(newTab.lastAccessed, newTabAccessedDate, "New tab's timestamp remains the same.");
23 gBrowser.removeTab(newTab);