OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../http/tests/inspector/console-test.js"></script> |
| 5 <script> |
| 6 function test() |
| 7 { |
| 8 var tzOffset = new Date(Date.now()).getTimezoneOffset() * 60 * 1000; |
| 9 var baseTimestamp = 1400000000000 + tzOffset; |
| 10 |
| 11 function addMessageWithFixedTimestamp(messageText, timestamp) |
| 12 { |
| 13 var message = new WebInspector.ConsoleMessage( |
| 14 WebInspector.ConsoleMessage.MessageSource.Other, // source |
| 15 WebInspector.ConsoleMessage.MessageLevel.Log, // level |
| 16 messageText, |
| 17 undefined, // type |
| 18 undefined, // url |
| 19 undefined, // line |
| 20 undefined, // column |
| 21 undefined, // requestId |
| 22 undefined, // parameters |
| 23 undefined, // stackTrace |
| 24 timestamp || baseTimestamp + 123, // timestamp: 2014-05-13T16:53:20.
123Z |
| 25 false); // isOutdated |
| 26 WebInspector.console.addMessage(message, true); // allowGrouping |
| 27 } |
| 28 |
| 29 InspectorTest.addResult("Console messages with timestamps disabled:"); |
| 30 addMessageWithFixedTimestamp("<Before>"); |
| 31 addMessageWithFixedTimestamp("<Before>"); |
| 32 addMessageWithFixedTimestamp("<Before>", baseTimestamp + 456); |
| 33 |
| 34 InspectorTest.dumpConsoleMessages(); |
| 35 |
| 36 InspectorTest.addResult("Console messages with timestamps enabled:"); |
| 37 WebInspector.settings.consoleTimestampsEnabled.set(true); |
| 38 |
| 39 addMessageWithFixedTimestamp("<After>"); |
| 40 addMessageWithFixedTimestamp("<After>"); |
| 41 addMessageWithFixedTimestamp("<After>", baseTimestamp + 456); |
| 42 |
| 43 InspectorTest.dumpConsoleMessages(); |
| 44 InspectorTest.completeTest(); |
| 45 } |
| 46 </script> |
| 47 </head> |
| 48 <body onload="runTest()"> |
| 49 <p> |
| 50 Tests the console timestamp setting. |
| 51 </p> |
| 52 </body> |
| 53 </html> |
OLD | NEW |