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

Unified Diff: third_party/WebKit/LayoutTests/inspector/tracing-browser-thread.html

Issue 2378843003: Timeline: fix screenshots for headless shell (Closed)
Patch Set: review comments addressed Created 4 years, 3 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-browser-thread-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-browser-thread.html
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing-browser-thread.html b/third_party/WebKit/LayoutTests/inspector/tracing-browser-thread.html
new file mode 100644
index 0000000000000000000000000000000000000000..9827e3e44a5cab183dd4abcb298da48e0f5e38d6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/tracing-browser-thread.html
@@ -0,0 +1,55 @@
+<html>
+<head>
+<script src="../http/tests/inspector/inspector-test.js"></script>
+<script src="../http/tests/inspector/timeline-test.js"></script>
+<script>
+function test()
+{
+ var sessionId = 1;
+
+ var testCases = {
+ "chrome": [
+ { "cat": "__metadata", "name": "process_name", "ph": "M", "pid": 1, "tid": 2, "ts": 0, "args": { "name": "Renderer" } },
+ { "cat": "__metadata", "name": "thread_name", "ph": "M", "pid": 1, "tid": 2, "ts": 0, "args": { "name": "CrRendererMain" } },
+ { "cat": "disabled-by-default-devtools.timeline", "ph": "I", "name": "TracingStartedInPage", "pid": 1, "tid": 2, "ts": 100000, "tts": 606543, "args": { "sessionId": sessionId, "page": "0x4age111" } },
+ { "cat": "__metadata", "name": "process_name", "ph": "M", "pid": 3, "tid": 4, "ts": 0, "args": { "name": "Browser" } },
+ { "cat": "__metadata", "name": "thread_name", "ph": "M", "pid": 3, "tid": 4, "ts": 0, "args": { "name": "CrBrowserMain" } },
+ { "cat": "disabled-by-default-devtools.timeline", "ph": "I", "name": "TracingStartedInPage", "pid": 1, "tid": 2, "ts": 100000, "tts": 606543, "args": { "sessionId": sessionId, "page": "0x4age111" } },
+ ],
+ "headless": [
+ { "cat": "__metadata", "name": "process_name", "ph": "M", "pid": 1, "tid": 2, "ts": 0, "args": { "name": "Renderer" } },
+ { "cat": "__metadata", "name": "thread_name", "ph": "M", "pid": 1, "tid": 2, "ts": 0, "args": { "name": "CrRendererMain" } },
+ { "cat": "disabled-by-default-devtools.timeline", "ph": "I", "name": "TracingStartedInPage", "pid": 1, "tid": 2, "ts": 100000, "tts": 606543, "args": { "sessionId": sessionId, "page": "0x4age111" } },
+ { "cat": "__metadata", "name": "process_name", "ph": "M", "pid": 3, "tid": 4, "ts": 0, "args": { "name": "HeadlessBrowser" } },
+ { "cat": "__metadata", "name": "thread_name", "ph": "M", "pid": 3, "tid": 4, "ts": 0, "args": { "name": "CrBrowserMain" } },
+ { "cat": "disabled-by-default-devtools.timeline", "ph": "I", "name": "TracingStartedInPage", "pid": 1, "tid": 2, "ts": 100000, "tts": 606543, "args": { "sessionId": sessionId, "page": "0x4age111" } },
+ ],
+ "weird-names": [
+ { "cat": "__metadata", "name": "process_name", "ph": "M", "pid": 1, "tid": 2, "ts": 0, "args": { "name": "Renderer" } },
+ { "cat": "__metadata", "name": "thread_name", "ph": "M", "pid": 1, "tid": 2, "ts": 0, "args": { "name": "CrRendererMain" } },
+ { "cat": "disabled-by-default-devtools.timeline", "ph": "I", "name": "TracingStartedInPage", "pid": 1, "tid": 2, "ts": 100000, "tts": 606543, "args": { "sessionId": sessionId, "page": "0x4age111" } },
+ { "cat": "__metadata", "name": "process_name", "ph": "M", "pid": 3, "tid": 4, "ts": 0, "args": { "name": "Foo" } },
+ { "cat": "__metadata", "name": "thread_name", "ph": "M", "pid": 3, "tid": 4, "ts": 0, "args": { "name": "Bar" } },
+ { "cat": "disabled-by-default-devtools.timeline", "ph": "I", "name": "TracingStartedInBrowser", "pid": 3, "tid": 4, "ts": 100000, "tts": 606543, "args": { "frameTreeNodeId": 1234 } },
+ ]
+ };
+ for (var testCase of Object.keys(testCases)) {
+ var model = InspectorTest.createTracingModel();
+ model.setEventsForTest(testCases[testCase]);
+ var browserMain = WebInspector.TracingModel.browserMainThread(model);
+ if (!browserMain) {
+ InspectorTest.addResult(`${testCase} failed, no browser main thread found`);
+ continue;
+ }
+ InspectorTest.addResult(`${testCase}: main browser thread is ${browserMain.name()} (#${browserMain.id()})`);
+ }
+ InspectorTest.completeTest();
+}
+
+</script>
+</head>
+<body onload="runTest()">
+<p>Test that tracing model correctly finds the main browser thread in the trace.
+</p>
+</body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/tracing-browser-thread-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698