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

Unified Diff: LayoutTests/inspector-protocol/timeline/timeline-start-bufferEvents.html

Issue 213003002: DevTools: allow whitelist of timeline events to be pushed live although in bufferEvent mode. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Same with front-end Created 6 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
Index: LayoutTests/inspector-protocol/timeline/timeline-start-bufferEvents.html
diff --git a/LayoutTests/inspector-protocol/timeline/timeline-start-bufferEvents.html b/LayoutTests/inspector-protocol/timeline/timeline-start-bufferEvents.html
index 56ec396709fe497655fb360ea5e0ccd82808d463..767e7d307987a272e59b3a9eeaf09c7720771a3b 100644
--- a/LayoutTests/inspector-protocol/timeline/timeline-start-bufferEvents.html
+++ b/LayoutTests/inspector-protocol/timeline/timeline-start-bufferEvents.html
@@ -3,35 +3,49 @@
<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
<script>
+function testFunction()
+{
+ console.timeStamp("Timestamp");
+ setTimeout(function() {
+ console.timeStamp("Timestamp in timer");
+ });
+}
+
function test()
{
InspectorTest.eventHandler["Timeline.eventRecorded"] = eventRecorded;
- InspectorTest.sendCommand("Timeline.start", { "bufferEvents": true }, onStart);
+ InspectorTest.log("Recording started");
+ InspectorTest.sendCommand("Timeline.start", { bufferEvents: true, liveEvents: "TimerFire" }, onStart);
function onStart(response)
{
- InspectorTest.sendCommand("Runtime.evaluate", { "expression": "0" }, onEvaluate);
+ InspectorTest.sendCommand("Runtime.evaluate", { "expression": "testFunction()" });
}
- function onEvaluate(response)
+ function eventRecorded(event)
{
InspectorTest.sendCommand("Timeline.stop", {}, onStop);
+ InspectorTest.log(" Event recorded: " + event.params.record.type);
}
function onStop(response)
{
+ InspectorTest.log("Recording stopped");
+ InspectorTest.log("Events:");
var events = response.result.events;
- for (var i = 0; i < events.length; ++i) {
- if (events[i].type === "GCEvent")
- continue;
- InspectorTest.log("Recording stopped: " + events[i].type);
- }
+ for (var i = 0; i < events.length; ++i)
+ dump(events[i], "");
InspectorTest.completeTest();
}
- function eventRecorded(message)
+ function dump(event, prefix)
{
- InspectorTest.log("Event recorded: " + message);
+ var eventTypes = { "FunctionCall":true, "TimeStamp":true, "TimerInstall":true, "TimerFire":true };
+ if (!(event.type in eventTypes))
+ return;
+ InspectorTest.log(prefix + event.type);
+ for (var i = 0; event.children && i < event.children.length; ++i)
+ dump(event.children[i], " " + prefix);
}
}
</script>

Powered by Google App Engine
This is Rietveld 408576698