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

Unified Diff: LayoutTests/inspector/tracing/timeline-dfs.html

Issue 477153005: DevTools: adopt existing Timeline tests for tracing based Timeline (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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: LayoutTests/inspector/tracing/timeline-dfs.html
diff --git a/LayoutTests/inspector/tracing/timeline-dfs.html b/LayoutTests/inspector/tracing/timeline-dfs.html
new file mode 100644
index 0000000000000000000000000000000000000000..6480bff46430ff2171512ea5bfaacfb63870e187
--- /dev/null
+++ b/LayoutTests/inspector/tracing/timeline-dfs.html
@@ -0,0 +1,70 @@
+<html>
+<head>
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../http/tests/inspector/timeline-test.js"></script>
+<script type="text/javascript">
+
+var test = function()
+{
+ WebInspector.inspectorView.showPanel("timeline");
+
+ function dumper(record)
+ {
+ InspectorTest.addResult(record.type());
+ }
+
+ var sessionId = "4.20";
+ var mainThread = 1;
+ var pid = 100;
+
+ var testData = [
+ {
+ "args": { "sessionId": sessionId },
+ "cat": "disabled-by-default-devtools.timeline",
+ "name": "TracingStartedInPage",
+ "ph": "I",
+ "pid": pid,
+ "tid": mainThread,
+ "ts": 100,
+ },
+ {"name": "a", "ts": 1000000, "ph": "B", "tid": mainThread, "pid": pid, "cat":"disabled-by-default.devtools.timeline", "args": {}},
+ {"name": "aa", "ts": 1000001, "ph": "B", "tid": mainThread, "pid": pid, "cat":"disabled-by-default.devtools.timeline", "args":{}},
+ {"name": "aaa", "ts": 1200000, "ph": "I", "tid": mainThread, "pid": pid, "cat":"disabled-by-default.devtools.timeline", "args":{}},
+ {"name": "aab", "ts": 1300000, "ph": "I", "tid": mainThread, "pid": pid, "cat":"disabled-by-default.devtools.timeline", "args":{}},
+ {"name": "aa", "ts": 1400000, "ph": "E", "tid": mainThread, "pid": pid, "cat":"disabled-by-default.devtools.timeline", "args": {}},
+ {"name": "ab", "ts": 1500001, "ph": "B", "tid": mainThread, "pid": pid, "cat":"disabled-by-default.devtools.timeline", "args":{}},
+ {"name": "aba", "ts": 1600000, "ph": "I", "tid": mainThread, "pid": pid, "cat":"disabled-by-default.devtools.timeline", "args":{}},
+ {"name": "abb", "ts": 1700000, "ph": "I", "tid": mainThread, "pid": pid, "cat":"disabled-by-default.devtools.timeline", "args":{}},
+ {"name": "ab", "ts": 1800000, "ph": "E", "tid": mainThread, "pid": pid, "cat":"disabled-by-default.devtools.timeline", "args": {}},
+ {"name": "a", "ts": 2000000, "ph": "E", "tid": mainThread, "pid": pid, "cat":"disabled-by-default.devtools.timeline", "args": {}},
+ {"name": "b", "ts": 3000000, "ph": "B", "tid": mainThread, "pid": pid, "cat":"disabled-by-default.devtools.timeline", "args": {}},
+ {"name": "ba", "ts": 3000001, "ph": "B", "tid": mainThread, "pid": pid, "cat":"disabled-by-default.devtools.timeline", "args":{}},
+ {"name": "baa", "ts": 3200000, "ph": "I", "tid": mainThread, "pid": pid, "cat":"disabled-by-default.devtools.timeline", "args":{}},
+ {"name": "bab", "ts": 3300000, "ph": "I", "tid": mainThread, "pid": pid, "cat":"disabled-by-default.devtools.timeline", "args":{}},
+ {"name": "ba", "ts": 3400000, "ph": "E", "tid": mainThread, "pid": pid, "cat":"disabled-by-default.devtools.timeline", "args": {}},
+ {"name": "bb", "ts": 3500001, "ph": "B", "tid": mainThread, "pid": pid, "cat":"disabled-by-default.devtools.timeline", "args":{}},
+ {"name": "bba", "ts": 3600000, "ph": "I", "tid": mainThread, "pid": pid, "cat":"disabled-by-default.devtools.timeline", "args":{}},
+ {"name": "bbb", "ts": 3700000, "ph": "I", "tid": mainThread, "pid": pid, "cat":"disabled-by-default.devtools.timeline", "args":{}},
+ {"name": "bb", "ts": 3800000, "ph": "E", "tid": mainThread, "pid": pid, "cat":"disabled-by-default.devtools.timeline", "args": {}},
+ {"name": "b", "ts": 4000000, "ph": "E", "tid": mainThread, "pid": pid, "cat":"disabled-by-default.devtools.timeline", "args": {}}
+ ];
+
+ // Reset filter to accept all records.
+ InspectorTest.timelineModel()._recordFilter = new WebInspector.TimelineModel.Filter();
+ InspectorTest.timelineModel().setEventsForTest(sessionId, testData);
+
+ InspectorTest.addResult("DFS preorder:");
+ InspectorTest.timelineModel().forAllRecords(dumper);
+ InspectorTest.addResult("");
+
+ InspectorTest.addResult("DFS postorder:");
+ InspectorTest.timelineModel().forAllRecords(null, dumper);
+ InspectorTest.completeTest();
+}
+
+</script>
+</head>
+<body onload="runTest()">
+<p>Tests TimelineModel.forAllRecords function.</p>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698