michael@0: /* vim:set ts=2 sw=2 sts=2 et: */ michael@0: /* ***** BEGIN LICENSE BLOCK ***** michael@0: * Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ michael@0: * michael@0: * Contributor(s): michael@0: * Patrick Walton michael@0: * michael@0: * ***** END LICENSE BLOCK ***** */ michael@0: michael@0: // Tests that appropriately-localized timestamps are printed. michael@0: michael@0: const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console.html"; michael@0: michael@0: function test() { michael@0: addTab(TEST_URI); michael@0: browser.addEventListener("DOMContentLoaded", testTimestamp, false); michael@0: michael@0: function testTimestamp() michael@0: { michael@0: browser.removeEventListener("DOMContentLoaded", testTimestamp, false); michael@0: const TEST_TIMESTAMP = 12345678; michael@0: let date = new Date(TEST_TIMESTAMP); michael@0: let localizedString = WCU_l10n.timestampString(TEST_TIMESTAMP); michael@0: isnot(localizedString.indexOf(date.getHours()), -1, "the localized " + michael@0: "timestamp contains the hours"); michael@0: isnot(localizedString.indexOf(date.getMinutes()), -1, "the localized " + michael@0: "timestamp contains the minutes"); michael@0: isnot(localizedString.indexOf(date.getSeconds()), -1, "the localized " + michael@0: "timestamp contains the seconds"); michael@0: isnot(localizedString.indexOf(date.getMilliseconds()), -1, "the localized " + michael@0: "timestamp contains the milliseconds"); michael@0: finishTest(); michael@0: } michael@0: } michael@0: