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

Unified Diff: third_party/WebKit/LayoutTests/inspector/tracing/timeline-js-line-level-profile.html

Issue 1748993002: DevTools: Initial implementation of line-level CPU profile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressing comments. Created 4 years, 9 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 | third_party/WebKit/LayoutTests/inspector/tracing/timeline-js-line-level-profile-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/inspector/tracing/timeline-js-line-level-profile.html
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js-line-level-profile.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js-line-level-profile.html
new file mode 100644
index 0000000000000000000000000000000000000000..8cc7241f61f5df392896d95f49f3f97608dfffa5
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js-line-level-profile.html
@@ -0,0 +1,82 @@
+<html>
+<head>
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../http/tests/inspector/debugger-test.js"></script>
+<script src="resources/timeline-data.js"></script>
+<script>
+function test()
+{
+ var cpuProfile = {
+ startTime: 10,
+ endTime: 20,
+ head: {
+ functionName: "(root)",
+ hitCount: 0,
+ children: [
+ {
+ functionName: "foo1",
+ hitCount: 100,
+ positionTicks: [{line:1, ticks:10}, {line:2, ticks:20}, {line:3, ticks:30}, {line:4, ticks:40}],
+ children: []
+ },
+ {
+ functionName: "foo2",
+ hitCount: 200,
+ positionTicks: [{line:100, ticks:1}, {line:102, ticks:190}],
+ children: []
+ },
+ {
+ functionName: "null",
+ hitCount: 0,
+ positionTicks: [],
+ children: [
+ {
+ functionName: "bar",
+ hitCount: 300,
+ positionTicks: [{line:55, ticks:22}],
+ children: []
+ },
+ {
+ functionName: "baz",
+ hitCount: 400,
+ // no positionTicks for the node.
+ children: []
+ }
+ ]
+ }
+ ]
+ }
+ };
+
+ InspectorTest.addSniffer(WebInspector.CodeMirrorTextEditor.prototype, "setGutterDecoration", decorationAdded, true);
+ InspectorTest.showScriptSource("timeline-data.js", frameRevealed);
+
+ function decorationAdded(line, type, element)
+ {
+ InspectorTest.addResult(`${line} ${type} ${element.textContent} ${element.style.backgroundColor}`);
+ }
+
+ function setUrls(url, node)
+ {
+ node.url = url;
+ node.children.forEach(setUrls.bind(null, url));
+ }
+
+ function frameRevealed(frame)
+ {
+ var url = frame.uiSourceCode().url();
+ InspectorTest.addResult(InspectorTest.formatters.formatAsURL(url));
+ setUrls(url, cpuProfile.head);
+ var lineProfile = new WebInspector.TimelineModel.LineLevelProfile();
+ lineProfile.appendCPUProfile(new WebInspector.CPUProfileDataModel(cpuProfile));
+ WebInspector.panels.timeline._setLineLevelCPUProfile(lineProfile);
+ setTimeout(() => InspectorTest.completeTest(), 0);
+ }
+}
+
+</script>
+</head>
+<body onload="runTest()">
+Tests that a line-level CPU profile is shown in the text editor.
+</body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/tracing/timeline-js-line-level-profile-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698