Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / timeline / timeline-window-filter.html
index 7e33f8f..2fd9620 100644 (file)
@@ -7,10 +7,8 @@
 
 function test()
 {
-    WebInspector.experimentsSettings.timelineFlameChart.enableForTest();
     var timelineData = InspectorTest.timelineData();
 
-    WebInspector.inspectorView.showPanel("timeline");
     var timeline = WebInspector.panels.timeline;
     var overviewPane = timeline._overviewPane;
     var model = timeline._model;
@@ -25,8 +23,9 @@ function test()
     model.loadFromFile({}, new WebInspector.Progress());
     timeline._currentViews[0]._refresh();
 
-    overviewPane._update();
+    overviewPane.update();
     InspectorTest.addResult("OverviewPane:");
+    overviewPane._overviewCalculator._setDisplayWindow(0, 450);
     dumpDividers(overviewPane._overviewCalculator);
     InspectorTest.addResult("");
 
@@ -35,10 +34,11 @@ function test()
         var view = timeline._currentViews[0];
         overviewPane._overviewGrid.setWindow(windowLeft, windowRight);
         view._refresh();
-        InspectorTest.addResult("mode = " + timeline._presentationModeSetting.get());
+        InspectorTest.addResult("mode = " + timeline._overviewModeSetting.get());
         InspectorTest.addResult("range = " + windowLeft + " - " + windowRight);
         InspectorTest.addResult("time range = " + view._windowStartTime + " - " + view._windowEndTime);
         InspectorTest.addResult("records count: " + view._presentationModel.filteredRecords().length);
+        view._calculator.setDisplayWindow(5, 455 + WebInspector.TimelineCalculator._minWidth);
         dumpDividers(view._calculator);
         InspectorTest.addResult("");
     }
@@ -48,62 +48,64 @@ function test()
         var mainView = timeline._currentViews[0]._mainView;
         overviewPane._overviewGrid.setWindow(windowLeft, windowRight);
         mainView.update();
-        InspectorTest.addResult("mode = " + timeline._presentationModeSetting.get());
+        InspectorTest.addResult("mode = " + timeline._overviewModeSetting.get());
         InspectorTest.addResult("range = " + windowLeft + " - " + windowRight);
         InspectorTest.addResult("time range = " + mainView._timeWindowLeft + " - " + mainView._timeWindowRight);
+        mainView._calculator.setDisplayWindow(5, 455 + WebInspector.TimelineCalculator._minWidth);
         dumpDividers(mainView._calculator);
         InspectorTest.addResult("");
     }
 
     function dumpDividers(calculator)
     {
-        var dividers = WebInspector.TimelineGrid.calculateDividerOffsets(calculator, 450).offsets;
+        var dividers = WebInspector.TimelineGrid.calculateDividerOffsets(calculator).offsets;
         for (var i = 0; i < dividers.length; ++i)
             dividers[i] -= calculator.zeroTime();
         InspectorTest.addResult("divider offsets: [" + dividers.join(", ") + "]. We are expecting round numbers.");
     }
 
-    timeline._onModeChanged(WebInspector.TimelinePanel.Mode.Events);
+    timeline._overviewModeSetting.set(WebInspector.TimelinePanel.OverviewMode.Events);
+    timeline._onModeChanged();
     dumpRecordsCountForRange(0, 1);
     dumpRecordsCountForRange(0.25, 0.75);
     dumpRecordsCountForRange(0.33, 0.66);
 
-    timeline._onModeChanged(WebInspector.TimelinePanel.Mode.Memory);
+    timeline._overviewModeSetting.set(WebInspector.TimelinePanel.OverviewMode.Frames);
+    timeline._onModeChanged();
     dumpRecordsCountForRange(0, 1);
     dumpRecordsCountForRange(0.25, 0.75);
     dumpRecordsCountForRange(0.33, 0.66);
 
-    timeline._onModeChanged(WebInspector.TimelinePanel.Mode.Frames);
-    dumpRecordsCountForRange(0, 1);
-    dumpRecordsCountForRange(0.25, 0.75);
-    dumpRecordsCountForRange(0.33, 0.66);
-
-    timeline._onModeChanged(WebInspector.TimelinePanel.Mode.FlameChart);
-    dumpFlameChartRecordsCountForRange(0, 1);
-    dumpFlameChartRecordsCountForRange(0.25, 0.5);
-    dumpFlameChartRecordsCountForRange(0.33, 0.4);
+    timeline._overviewModeSetting.set(WebInspector.TimelinePanel.OverviewMode.Frames);
+    timeline._flameChartEnabledSetting.set(true);
+    timeline._onModeChanged();
+    // FIXME(394762): uncomment once we support loading tracing events.
+//     dumpFlameChartRecordsCountForRange(0, 1);
+//     dumpFlameChartRecordsCountForRange(0.25, 0.5);
+//     dumpFlameChartRecordsCountForRange(0.33, 0.4);
 
     overviewPane._overviewGrid.setWindow(0.1, 0.9);
 
     InspectorTest.addResult("--------------------------------------------------------");
-    InspectorTest.addResult("mode = " + timeline._presentationModeSetting.get());
+    InspectorTest.addResult("mode = " + timeline._overviewModeSetting.get());
     InspectorTest.addResult("time range = " + timeline._windowStartTime + " - " + timeline._windowEndTime);
-    timeline._onModeChanged(WebInspector.TimelinePanel.Mode.Events);
-    InspectorTest.addResult("");
 
-    InspectorTest.addResult("mode = " + timeline._presentationModeSetting.get());
-    InspectorTest.addResult("time range = " + timeline._windowStartTime + " - " + timeline._windowEndTime);
-    timeline._onModeChanged(WebInspector.TimelinePanel.Mode.Memory);
+    timeline._overviewModeSetting.set(WebInspector.TimelinePanel.OverviewMode.Events);
+    timeline._flameChartEnabledSetting.set(false);
+    timeline._onModeChanged();
     InspectorTest.addResult("");
 
-    InspectorTest.addResult("mode = " + timeline._presentationModeSetting.get());
+    InspectorTest.addResult("mode = " + timeline._overviewModeSetting.get());
     InspectorTest.addResult("time range = " + timeline._windowStartTime + " - " + timeline._windowEndTime);
-    timeline._onModeChanged(WebInspector.TimelinePanel.Mode.Frames);
+    timeline._overviewModeSetting.set(WebInspector.TimelinePanel.OverviewMode.Frames);
+    timeline._onModeChanged();
     InspectorTest.addResult("");
 
-    InspectorTest.addResult("mode = " + timeline._presentationModeSetting.get());
+    InspectorTest.addResult("mode = " + timeline._overviewModeSetting.get());
     InspectorTest.addResult("time range = " + timeline._windowStartTime + " - " + timeline._windowEndTime);
-    timeline._onModeChanged(WebInspector.TimelinePanel.Mode.FlameChart);
+    timeline._overviewModeSetting.set(WebInspector.TimelinePanel.OverviewMode.Frames);
+    timeline._flameChartEnabledSetting.set(true);
+    timeline._onModeChanged();
 
     InspectorTest.completeTest();
 }