| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | |
| 4 <script src="../../http/tests/inspector/timeline-test.js"></script> | |
| 5 <script> | |
| 6 | |
| 7 function simpleConsoleTime() | |
| 8 { | |
| 9 console.time("a"); | |
| 10 console.timeEnd("a"); | |
| 11 } | |
| 12 | |
| 13 function nestedConsoleTime() | |
| 14 { | |
| 15 console.time("a"); | |
| 16 { | |
| 17 console.time("b"); | |
| 18 console.timeEnd("b"); | |
| 19 { | |
| 20 console.time("c"); | |
| 21 { | |
| 22 console.time("d"); | |
| 23 console.timeEnd("d"); | |
| 24 } | |
| 25 console.timeEnd("c"); | |
| 26 } | |
| 27 } | |
| 28 console.timeEnd("a"); | |
| 29 } | |
| 30 | |
| 31 | |
| 32 function unbalancedConsoleTime() | |
| 33 { | |
| 34 console.time("a"); | |
| 35 console.time("b"); | |
| 36 console.timeEnd("a"); | |
| 37 console.timeEnd("b"); | |
| 38 } | |
| 39 | |
| 40 function consoleTimeWithoutConsoleTimeEnd() | |
| 41 { | |
| 42 console.timeStamp("Foo"); | |
| 43 console.time("a"); | |
| 44 console.timeStamp("Bar"); | |
| 45 console.time("b"); | |
| 46 console.time("c"); | |
| 47 console.time("d"); | |
| 48 console.timeStamp("Baz"); | |
| 49 console.timeEnd("d"); | |
| 50 } | |
| 51 | |
| 52 function test() | |
| 53 { | |
| 54 InspectorTest.startDumpingProtocolMessages(); | |
| 55 InspectorTest.runTestSuite([ | |
| 56 function testSimpleConsoleTime(next) | |
| 57 { | |
| 58 performActions("simpleConsoleTime()", next); | |
| 59 }, | |
| 60 | |
| 61 function testNestedConsoleTime(next) | |
| 62 { | |
| 63 performActions("nestedConsoleTime()", next); | |
| 64 }, | |
| 65 | |
| 66 function testUnbalancedConsoleTime(next) | |
| 67 { | |
| 68 performActions("unbalancedConsoleTime()", next); | |
| 69 }, | |
| 70 | |
| 71 function testConsoleTimeWithoutConsoleTimeEnd(next) | |
| 72 { | |
| 73 performActions("consoleTimeWithoutConsoleTimeEnd()", next); | |
| 74 } | |
| 75 ]); | |
| 76 | |
| 77 function performActions(actions, next) | |
| 78 { | |
| 79 function callback() | |
| 80 { | |
| 81 var rootRecord = InspectorTest.timelinePresentationModel().rootRecor
d(); | |
| 82 InspectorTest.dumpPresentationRecord(rootRecord, undefined, undefine
d, ["FunctionCall", "ConsoleTime", "TimeStamp"]); | |
| 83 InspectorTest.timelinePresentationModel().reset(); | |
| 84 next(); | |
| 85 } | |
| 86 InspectorTest.evaluateWithTimeline(actions, callback) | |
| 87 } | |
| 88 } | |
| 89 | |
| 90 </script> | |
| 91 </head> | |
| 92 | |
| 93 <body onload="runTest()"> | |
| 94 <p>Test nesting of time/timeEnd records on Timeline</p> | |
| 95 | |
| 96 </body> | |
| 97 </html> | |
| OLD | NEW |