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

Unified Diff: LayoutTests/http/tests/inspector/timeline-test.js

Issue 399043002: DevTools: switch Timeline frontend into buffered mode and remove the corresponding experiment. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: timeline-websocket-event rebaselined Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/http/tests/inspector/timeline-xhr-event.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/inspector/timeline-test.js
diff --git a/LayoutTests/http/tests/inspector/timeline-test.js b/LayoutTests/http/tests/inspector/timeline-test.js
index a0e8890a7c321a96c711f507e285c35765ff2b6c..54ababbaaeb91ca8822f235f8847125f5948820f 100644
--- a/LayoutTests/http/tests/inspector/timeline-test.js
+++ b/LayoutTests/http/tests/inspector/timeline-test.js
@@ -41,11 +41,12 @@ InspectorTest.timelineModel = function()
InspectorTest.startTimeline = function(callback)
{
InspectorTest._timelineRecords = [];
- WebInspector.inspectorView.panel("timeline").toggleTimelineButton.toggled = true;
- WebInspector.inspectorView.panel("timeline")._model._collectionEnabled = true;
- WebInspector.inspectorView.panel("timeline")._model._currentTarget = WebInspector.targetManager.mainTarget();
-
- TimelineAgent.start(5, false, undefined, true, false, callback);
+ var panel = WebInspector.inspectorView.panel("timeline");
+ panel.toggleTimelineButton.toggled = true;
+ panel._model._collectionEnabled = true;
+ panel._userInitiatedRecording = true;
+ panel._model._currentTarget = WebInspector.targetManager.mainTarget();
+ TimelineAgent.start(5, true, undefined, true, false, callback);
function addRecord(record)
{
InspectorTest._timelineRecords.push(record);
@@ -59,34 +60,16 @@ InspectorTest.startTimeline = function(callback)
WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.EventTypes.TimelineEventRecorded, InspectorTest._addTimelineEvent);
};
-
-InspectorTest.waitForRecordType = function(recordType, callback)
-{
- WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.EventTypes.TimelineEventRecorded, addEvent);
-
- function addEvent(event)
- {
- addRecord(event.data);
- }
- function addRecord(record)
- {
- if (record.type !== WebInspector.TimelineModel.RecordType[recordType]) {
- for (var i = 0; record.children && i < record.children.length; ++i)
- addRecord(record.children[i]);
- return;
- }
- WebInspector.timelineManager.removeEventListener(WebInspector.TimelineManager.EventTypes.TimelineEventRecorded, addEvent);
- callback(record);
- }
-}
-
InspectorTest.stopTimeline = function(callback)
{
- function didStop()
+ function didStop(error)
{
+ if (error)
+ testRunner.logToStderr("error: " + error);
WebInspector.timelineManager.removeEventListener(WebInspector.TimelineManager.EventTypes.TimelineEventRecorded, InspectorTest._addTimelineEvent);
- WebInspector.inspectorView.panel("timeline").toggleTimelineButton.toggled = false;
- WebInspector.inspectorView.panel("timeline")._model._collectionEnabled = false;
+ var panel = WebInspector.inspectorView.panel("timeline");
+ panel.toggleTimelineButton.toggled = false;
+ panel._userInitiatedRecording = false;
callback(InspectorTest._timelineRecords);
}
TimelineAgent.stop(didStop);
@@ -141,6 +124,30 @@ InspectorTest.performActionsAndPrint = function(actions, typeName, includeTimeSt
InspectorTest.evaluateWithTimeline(actions, callback);
};
+InspectorTest.filterTimelineRecords = function(typeName, firstOnly)
+{
+ var filteredRecords = [];
+ filterRecords(typeName, InspectorTest._timelineRecords);
+ return filteredRecords;
+
+ function filterRecords(typeName, records)
+ {
+ if (!records)
+ return false;
+ for (var i = 0; i < records.length; ++i) {
+ var recordTypeName = (typeof records[i].type === "string") ? records[i].type : records[i].type();
+ if (typeName && recordTypeName === WebInspector.TimelineModel.RecordType[typeName]) {
+ filteredRecords.push(records[i]);
+ if (firstOnly)
+ return true;
+ }
+ if (filterRecords(typeName, records[i].children))
+ return true;
+ }
+ return false;
+ }
+}
+
InspectorTest.printTimelineRecords = function(typeName, formatter)
{
InspectorTest.innerPrintTimelineRecords(InspectorTest._timelineRecords, typeName, formatter);
« no previous file with comments | « no previous file | LayoutTests/http/tests/inspector/timeline-xhr-event.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698