Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(361)

Side by Side Diff: LayoutTests/inspector/console/console-timestamp.html

Issue 881263002: DevTools: use target-based model accessors only. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script> 3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/console-test.js"></script> 4 <script src="../../http/tests/inspector/console-test.js"></script>
5 <script> 5 <script>
6 function test() 6 function test()
7 { 7 {
8 // It is essential that we calculate timezone for this particular moment of time 8 // It is essential that we calculate timezone for this particular moment of time
9 // otherwise the time zone offset could be different because of DST. 9 // otherwise the time zone offset could be different because of DST.
10 var baseDate = Date.parse("2014-05-13T16:53:20.123Z"); 10 var baseDate = Date.parse("2014-05-13T16:53:20.123Z");
11 var tzOffset = new Date(baseDate).getTimezoneOffset() * 60 * 1000; 11 var tzOffset = new Date(baseDate).getTimezoneOffset() * 60 * 1000;
12 var baseTimestamp = 1400000000000 + tzOffset; 12 var baseTimestamp = 1400000000000 + tzOffset;
13 13
14 function addMessageWithFixedTimestamp(messageText, timestamp) 14 function addMessageWithFixedTimestamp(messageText, timestamp)
15 { 15 {
16 var message = new WebInspector.ConsoleMessage( 16 var message = new WebInspector.ConsoleMessage(
17 WebInspector.consoleModel.target(), 17 InspectorTest.consoleModel.target(),
18 WebInspector.ConsoleMessage.MessageSource.Other, // source 18 WebInspector.ConsoleMessage.MessageSource.Other, // source
19 WebInspector.ConsoleMessage.MessageLevel.Log, // level 19 WebInspector.ConsoleMessage.MessageLevel.Log, // level
20 messageText, 20 messageText,
21 undefined, // type 21 undefined, // type
22 undefined, // url 22 undefined, // url
23 undefined, // line 23 undefined, // line
24 undefined, // column 24 undefined, // column
25 undefined, // requestId 25 undefined, // requestId
26 undefined, // parameters 26 undefined, // parameters
27 undefined, // stackTrace 27 undefined, // stackTrace
28 timestamp || baseTimestamp + 123, // timestamp: 2014-05-13T16:53:20. 123Z 28 timestamp || baseTimestamp + 123, // timestamp: 2014-05-13T16:53:20. 123Z
29 false); // isOutdated 29 false); // isOutdated
30 WebInspector.consoleModel.addMessage(message, true); // allowGrouping 30 InspectorTest.consoleModel.addMessage(message, true); // allowGrouping
31 } 31 }
32 32
33 InspectorTest.addResult("Console messages with timestamps disabled:"); 33 InspectorTest.addResult("Console messages with timestamps disabled:");
34 addMessageWithFixedTimestamp("<Before>"); 34 addMessageWithFixedTimestamp("<Before>");
35 addMessageWithFixedTimestamp("<Before>", baseTimestamp + 456); 35 addMessageWithFixedTimestamp("<Before>", baseTimestamp + 456);
36 addMessageWithFixedTimestamp("<Before>"); 36 addMessageWithFixedTimestamp("<Before>");
37 37
38 InspectorTest.dumpConsoleMessages(); 38 InspectorTest.dumpConsoleMessages();
39 39
40 InspectorTest.addResult("Console messages with timestamps enabled:"); 40 InspectorTest.addResult("Console messages with timestamps enabled:");
(...skipping 10 matching lines...) Expand all
51 InspectorTest.completeTest(); 51 InspectorTest.completeTest();
52 } 52 }
53 </script> 53 </script>
54 </head> 54 </head>
55 <body onload="runTest()"> 55 <body onload="runTest()">
56 <p> 56 <p>
57 Tests the console timestamp setting. 57 Tests the console timestamp setting.
58 </p> 58 </p>
59 </body> 59 </body>
60 </html> 60 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698