| OLD | NEW |
| 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/timeline-test.js"></script> | 4 <script src="../../http/tests/inspector/timeline-test.js"></script> |
| 5 <script src="resources/timeline-data.js"></script> | 5 <script src="resources/timeline-data.js"></script> |
| 6 <script> | 6 <script> |
| 7 | 7 |
| 8 function test() | 8 function test() |
| 9 { | 9 { |
| 10 var timelineData = InspectorTest.timelineData(); | 10 var timelineData = InspectorTest.timelineData(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 InspectorTest.addResult("OverviewPane:"); | 28 InspectorTest.addResult("OverviewPane:"); |
| 29 overviewPane._overviewCalculator.setDisplayWindow(450); | 29 overviewPane._overviewCalculator.setDisplayWindow(450); |
| 30 dumpDividers(overviewPane._overviewCalculator); | 30 dumpDividers(overviewPane._overviewCalculator); |
| 31 InspectorTest.addResult(""); | 31 InspectorTest.addResult(""); |
| 32 | 32 |
| 33 function dumpRecordsCountForRange(windowLeft, windowRight) | 33 function dumpRecordsCountForRange(windowLeft, windowRight) |
| 34 { | 34 { |
| 35 var view = timeline._currentViews[0]; | 35 var view = timeline._currentViews[0]; |
| 36 overviewPane._overviewGrid.setWindow(windowLeft, windowRight); | 36 overviewPane._overviewGrid.setWindow(windowLeft, windowRight); |
| 37 view._refresh(); | 37 view._refresh(); |
| 38 InspectorTest.addResult("mode = " + timeline._overviewModeSetting.get())
; | |
| 39 InspectorTest.addResult("range = " + windowLeft + " - " + windowRight); | 38 InspectorTest.addResult("range = " + windowLeft + " - " + windowRight); |
| 40 InspectorTest.addResult("time range = " + view._windowStartTime + " - "
+ view._windowEndTime); | 39 InspectorTest.addResult("time range = " + view._windowStartTime + " - "
+ view._windowEndTime); |
| 41 InspectorTest.addResult("records count: " + view._presentationModel.filt
eredRecords().length); | 40 InspectorTest.addResult("records count: " + view._presentationModel.filt
eredRecords().length); |
| 42 view._calculator.setDisplayWindow(455 + WebInspector.TimelineCalculator.
_minWidth, 5); | 41 view._calculator.setDisplayWindow(455 + WebInspector.TimelineCalculator.
_minWidth, 5); |
| 43 dumpDividers(view._calculator); | 42 dumpDividers(view._calculator); |
| 44 InspectorTest.addResult(""); | 43 InspectorTest.addResult(""); |
| 45 } | 44 } |
| 46 | 45 |
| 47 function dumpFlameChartRecordsCountForRange(windowLeft, windowRight) | 46 function dumpFlameChartRecordsCountForRange(windowLeft, windowRight) |
| 48 { | 47 { |
| 49 var mainView = timeline._currentViews[0]._mainView; | 48 var mainView = timeline._currentViews[0]._mainView; |
| 50 overviewPane._overviewGrid.setWindow(windowLeft, windowRight); | 49 overviewPane._overviewGrid.setWindow(windowLeft, windowRight); |
| 51 mainView.update(); | 50 mainView.update(); |
| 52 InspectorTest.addResult("mode = " + timeline._overviewModeSetting.get())
; | |
| 53 InspectorTest.addResult("range = " + windowLeft + " - " + windowRight); | 51 InspectorTest.addResult("range = " + windowLeft + " - " + windowRight); |
| 54 InspectorTest.addResult("time range = " + mainView._timeWindowLeft + " -
" + mainView._timeWindowRight); | 52 InspectorTest.addResult("time range = " + mainView._timeWindowLeft + " -
" + mainView._timeWindowRight); |
| 55 mainView._calculator.setDisplayWindow(455 + WebInspector.TimelineCalcula
tor._minWidth, 5); | 53 mainView._calculator.setDisplayWindow(455 + WebInspector.TimelineCalcula
tor._minWidth, 5); |
| 56 dumpDividers(mainView._calculator); | 54 dumpDividers(mainView._calculator); |
| 57 InspectorTest.addResult(""); | 55 InspectorTest.addResult(""); |
| 58 } | 56 } |
| 59 | 57 |
| 60 function dumpDividers(calculator) | 58 function dumpDividers(calculator) |
| 61 { | 59 { |
| 62 var dividers = WebInspector.TimelineGrid.calculateDividerOffsets(calcula
tor).offsets; | 60 var dividers = WebInspector.TimelineGrid.calculateDividerOffsets(calcula
tor).offsets; |
| 63 for (var i = 0; i < dividers.length; ++i) | 61 for (var i = 0; i < dividers.length; ++i) |
| 64 dividers[i] -= calculator.zeroTime(); | 62 dividers[i] -= calculator.zeroTime(); |
| 65 InspectorTest.addResult("divider offsets: [" + dividers.join(", ") + "].
We are expecting round numbers."); | 63 InspectorTest.addResult("divider offsets: [" + dividers.join(", ") + "].
We are expecting round numbers."); |
| 66 } | 64 } |
| 67 | 65 |
| 68 timeline._overviewModeSetting.set(WebInspector.TimelinePanel.OverviewMode.Ev
ents); | |
| 69 timeline._onModeChanged(); | 66 timeline._onModeChanged(); |
| 70 dumpRecordsCountForRange(0, 1); | 67 dumpRecordsCountForRange(0, 1); |
| 71 dumpRecordsCountForRange(0.25, 0.75); | 68 dumpRecordsCountForRange(0.25, 0.75); |
| 72 dumpRecordsCountForRange(0.33, 0.66); | 69 dumpRecordsCountForRange(0.33, 0.66); |
| 73 | 70 |
| 74 timeline._overviewModeSetting.set(WebInspector.TimelinePanel.OverviewMode.Fr
ames); | |
| 75 timeline._onModeChanged(); | |
| 76 dumpRecordsCountForRange(0, 1); | |
| 77 dumpRecordsCountForRange(0.25, 0.75); | |
| 78 dumpRecordsCountForRange(0.33, 0.66); | |
| 79 | |
| 80 timeline._overviewModeSetting.set(WebInspector.TimelinePanel.OverviewMode.Fr
ames); | |
| 81 timeline._flameChartEnabledSetting.set(true); | 71 timeline._flameChartEnabledSetting.set(true); |
| 82 timeline._onModeChanged(); | 72 timeline._onModeChanged(); |
| 83 // FIXME(394762): uncomment once we support loading tracing events. | 73 // FIXME(394762): uncomment once we support loading tracing events. |
| 84 // dumpFlameChartRecordsCountForRange(0, 1); | 74 // dumpFlameChartRecordsCountForRange(0, 1); |
| 85 // dumpFlameChartRecordsCountForRange(0.25, 0.5); | 75 // dumpFlameChartRecordsCountForRange(0.25, 0.5); |
| 86 // dumpFlameChartRecordsCountForRange(0.33, 0.4); | 76 // dumpFlameChartRecordsCountForRange(0.33, 0.4); |
| 87 | 77 |
| 88 overviewPane._overviewGrid.setWindow(0.1, 0.9); | 78 overviewPane._overviewGrid.setWindow(0.1, 0.9); |
| 89 | 79 |
| 90 InspectorTest.addResult("---------------------------------------------------
-----"); | 80 InspectorTest.addResult("---------------------------------------------------
-----"); |
| 91 InspectorTest.addResult("mode = " + timeline._overviewModeSetting.get()); | 81 |
| 92 InspectorTest.addResult("time range = " + timeline._windowStartTime + " - "
+ timeline._windowEndTime); | 82 InspectorTest.addResult("time range = " + timeline._windowStartTime + " - "
+ timeline._windowEndTime); |
| 93 | |
| 94 timeline._overviewModeSetting.set(WebInspector.TimelinePanel.OverviewMode.Ev
ents); | |
| 95 timeline._flameChartEnabledSetting.set(false); | 83 timeline._flameChartEnabledSetting.set(false); |
| 96 timeline._onModeChanged(); | 84 timeline._onModeChanged(); |
| 85 |
| 97 InspectorTest.addResult(""); | 86 InspectorTest.addResult(""); |
| 98 | 87 |
| 99 InspectorTest.addResult("mode = " + timeline._overviewModeSetting.get()); | |
| 100 InspectorTest.addResult("time range = " + timeline._windowStartTime + " - "
+ timeline._windowEndTime); | 88 InspectorTest.addResult("time range = " + timeline._windowStartTime + " - "
+ timeline._windowEndTime); |
| 101 timeline._overviewModeSetting.set(WebInspector.TimelinePanel.OverviewMode.Fr
ames); | |
| 102 timeline._onModeChanged(); | |
| 103 InspectorTest.addResult(""); | |
| 104 | |
| 105 InspectorTest.addResult("mode = " + timeline._overviewModeSetting.get()); | |
| 106 InspectorTest.addResult("time range = " + timeline._windowStartTime + " - "
+ timeline._windowEndTime); | |
| 107 timeline._overviewModeSetting.set(WebInspector.TimelinePanel.OverviewMode.Fr
ames); | |
| 108 timeline._flameChartEnabledSetting.set(true); | 89 timeline._flameChartEnabledSetting.set(true); |
| 109 timeline._onModeChanged(); | 90 timeline._onModeChanged(); |
| 110 | 91 |
| 111 InspectorTest.completeTest(); | 92 InspectorTest.completeTest(); |
| 112 } | 93 } |
| 113 | 94 |
| 114 </script> | 95 </script> |
| 115 </head> | 96 </head> |
| 116 | 97 |
| 117 <body onload="runTest()"> | 98 <body onload="runTest()"> |
| 118 <p> | 99 <p> |
| 119 Tests the Timeline window filter. | 100 Tests the Timeline window filter. |
| 120 </p> | 101 </p> |
| 121 | 102 |
| 122 <p> | 103 <p> |
| 123 It applies different ranges to the OverviewGrid and expects that current view re
flects the change. | 104 It applies different ranges to the OverviewGrid and expects that current view re
flects the change. |
| 124 </p> | 105 </p> |
| 125 <p> | 106 <p> |
| 126 Also it detects that after switching to another view it gets the proper time ran
ge. | 107 Also it detects that after switching to another view it gets the proper time ran
ge. |
| 127 </p> | 108 </p> |
| 128 | 109 |
| 129 </body> | 110 </body> |
| 130 </html> | 111 </html> |
| OLD | NEW |