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

Unified Diff: LayoutTests/inspector/timeline/timeline-session-id.html

Issue 247513002: Timeline: produce session cookie when timeline is started (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: use IndetifiersFactory instead of directly getting processId Created 6 years, 8 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/inspector/timeline/timeline-session-id-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/inspector/timeline/timeline-session-id.html
diff --git a/LayoutTests/inspector/timeline/timeline-session-id.html b/LayoutTests/inspector/timeline/timeline-session-id.html
new file mode 100644
index 0000000000000000000000000000000000000000..26159066eb8b5df4e927f6a40f9ca1e4f72bc5a3
--- /dev/null
+++ b/LayoutTests/inspector/timeline/timeline-session-id.html
@@ -0,0 +1,54 @@
+<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;
+
+ // FIXME: remove BOTH lines below when tracing is out of experimental!
+ WebInspector.experimentsSettings.timelineTracingMode.enableForTest();
+ TimelineAgent.enable(WebInspector.TimelineManager.defaultTracingCategories);
+
+ WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.EventTypes.TimelineStarted, onTimelineStarted);
+ WebInspector.timelineManager.start();
+ var tracingModel = new WebInspector.TracingModel();
+ tracingModel.start(WebInspector.TracingModel.DevToolsMetadataEventCategory + ",-*", "");
+
+ function onTimelineStarted()
+ {
+ sessionId = WebInspector.timelineManager.sessionId();
+ WebInspector.timelineManager.stop(function() { });
+ tracingModel.stop(processTracingEvents);
+ }
+
+ function processTracingEvents()
+ {
+ tracingModel.sortedProcesses().forEach(function(process) {
+ process.sortedThreads().forEach(function(thread) {
+ thread.events().forEach(processEvent);
+ });
+ });
+ InspectorTest.completeTest();
+ }
+
+ function processEvent(event)
+ {
+ if (event.category !== WebInspector.TracingModel.DevToolsMetadataEventCategory ||
+ Object.values(WebInspector.TracingModel.DevToolsMetadataEvent).indexOf(event.name) < 0) {
+ return;
+ }
+ InspectorTest.assertEquals(sessionId, event.args["sessionId"]);
+ InspectorTest.addResult("Got DevTools metadata event: " + event.name);
+ }
+}
+</script>
+
+<body onload="runTestAfterDisplay()">
+<p style="-webkit-transform: translateZ(10px)"> <!-- Force compositing so we have SetLayerTreeHostId event as well -->
+Tests that Timeline returns a session id upon a start that is matching one issued in trace events.
+</p>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/inspector/timeline/timeline-session-id-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698