Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* vim:set ts=2 sw=2 sts=2 et: */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Any copyright is dedicated to the Public Domain.
4 * http://creativecommons.org/publicdomain/zero/1.0/
5 *
6 * Contributor(s):
7 * Patrick Walton <pcwalton@mozilla.com>
8 *
9 * ***** END LICENSE BLOCK ***** */
11 // Tests that appropriately-localized timestamps are printed.
13 const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console.html";
15 function test() {
16 addTab(TEST_URI);
17 browser.addEventListener("DOMContentLoaded", testTimestamp, false);
19 function testTimestamp()
20 {
21 browser.removeEventListener("DOMContentLoaded", testTimestamp, false);
22 const TEST_TIMESTAMP = 12345678;
23 let date = new Date(TEST_TIMESTAMP);
24 let localizedString = WCU_l10n.timestampString(TEST_TIMESTAMP);
25 isnot(localizedString.indexOf(date.getHours()), -1, "the localized " +
26 "timestamp contains the hours");
27 isnot(localizedString.indexOf(date.getMinutes()), -1, "the localized " +
28 "timestamp contains the minutes");
29 isnot(localizedString.indexOf(date.getSeconds()), -1, "the localized " +
30 "timestamp contains the seconds");
31 isnot(localizedString.indexOf(date.getMilliseconds()), -1, "the localized " +
32 "timestamp contains the milliseconds");
33 finishTest();
34 }
35 }