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

Unified Diff: third_party/WebKit/LayoutTests/inspector/tracing/tracing-timeline-load.html

Issue 1755123003: Timeline: quit using Progress, introduce TimelineLifecycleDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments addressed Created 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/inspector/tracing/tracing-timeline-load.html
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/tracing-timeline-load.html b/third_party/WebKit/LayoutTests/inspector/tracing/tracing-timeline-load.html
index 5739094504eafd4060fd88ed637f4e4d03e8859d..559c36e10bf7848943773aa7ee30c4e329b3049e 100644
--- a/third_party/WebKit/LayoutTests/inspector/tracing/tracing-timeline-load.html
+++ b/third_party/WebKit/LayoutTests/inspector/tracing/tracing-timeline-load.html
@@ -7,10 +7,28 @@
function test()
{
+ InspectorTest.TestTimelineLifecycleDelegate = function() {}
+
+ InspectorTest.TestTimelineLifecycleDelegate.prototype = {
+ loadingStarted: function()
+ {
+ InspectorTest.addResult("TimelineLifecycleDelegate.loadingStarted()");
+ },
+
+ loadingProgress: function()
+ {
+ InspectorTest.addResult("TimelineLifecycleDelegate.loadingProgress()");
+ },
+
+ loadingComplete: function(success)
+ {
+ InspectorTest.addResult(`TimelineLifecycleDelegate.loadingComplete(${success})`);
+ },
+ }
+
function runTestWithDataAndCheck(input, expectedOutput, callback)
{
- InspectorTest.tracingModel().reset();
- var model = InspectorTest.tracingTimelineModel();
+ var model = InspectorTest.tracingModel();
model.reset();
var timeline = WebInspector.panels.timeline;
@@ -27,18 +45,20 @@ function test()
}
InspectorTest.override(WebInspector.TimelineLoader, "_createFileReader", createFileReader);
- WebInspector.TimelineLoader.loadFromFile(model, {}, new WebInspector.Progress());
+ WebInspector.TimelineLoader.loadFromFile(model, {}, new InspectorTest.TestTimelineLifecycleDelegate());
+ model.tracingComplete();
+ var saver = new WebInspector.TracingTimelineSaver();
var stream = new InspectorTest.StringOutputStream(InspectorTest.safeWrap(checkSaveData));
- var saver = new WebInspector.TracingTimelineSaver(stream);
var storage = timeline._tracingModelBackingStorage;
stream.open("", storage.writeToStream.bind(storage, stream, saver));
}
function runTestOnMalformedInput(input, callback)
{
- InspectorTest.tracingModel().reset();
- var model = InspectorTest.tracingTimelineModel();
+ var model = InspectorTest.tracingModel();
+ var timeline = WebInspector.panels.timeline;
+
model.reset();
function createFileReader(file, delegate)
@@ -48,12 +68,12 @@ function test()
function checkLoadedData(data)
{
- InspectorTest.addResult("Model is empty: " + model.isEmpty());
+ InspectorTest.addResult("Model is empty: " + (!model.minimumRecordTime() && !model.maximumRecordTime()));
callback();
}
InspectorTest.override(WebInspector.TimelineLoader, "_createFileReader", createFileReader);
- WebInspector.TimelineLoader.loadFromFile(model, {}, new WebInspector.Progress());
+ WebInspector.TimelineLoader.loadFromFile(model, {}, new InspectorTest.TestTimelineLifecycleDelegate());
}
var data = [{"args":{"number":32},"cat":"__metadata","name":"num_cpus","ph":"M","pid":32127,"tid":0,"ts":0},

Powered by Google App Engine
This is Rietveld 408576698