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

Unified Diff: LayoutTests/inspector/timeline/timeline-gc-event.html

Issue 235043002: TimelinePanel: make GC events synchronous. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: and expectations 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
Index: LayoutTests/inspector/timeline/timeline-gc-event.html
diff --git a/LayoutTests/inspector/timeline/timeline-gc-event.html b/LayoutTests/inspector/timeline/timeline-gc-event.html
new file mode 100644
index 0000000000000000000000000000000000000000..cffb4fbfc9194ea374c4a0ef997f308315116609
--- /dev/null
+++ b/LayoutTests/inspector/timeline/timeline-gc-event.html
@@ -0,0 +1,49 @@
+<html>
+<head>
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../http/tests/inspector/timeline-test.js"></script>
+<script>
+
+function produceGarbageForGCEvents(callback)
+{
+ var array = [];
+ for (var i = 0; i < 1000; ++i) {
+ array = [];
+ for (var j = 0; j < 10000; ++j)
+ array.push(Math.random());
+ }
+ if (window.testRunner)
yurys 2014/04/11 13:46:03 maybe call testRunner.gc() instead?
+ testRunner.displayAsyncThen(callback);
+}
+
+function test()
+{
+ InspectorTest.invokeAsyncWithTimeline("produceGarbageForGCEvents", validate);
+
+ function validate(records)
+ {
+ for (var i = 0; i < records.length; ++i) {
+ var record = records[i];
+ if (record.type === WebInspector.TimelineModel.RecordType.GCEvent) {
yurys 2014/04/11 13:46:03 What if there is more than one GCEvent?
+ InspectorTest.addResult("The expected GC event record");
+ InspectorTest.addObject(record, InspectorTest.timelinePropertyFormatters);
+
+ InspectorTest.addResult("The expected first call frame for GC event record call stack");
+ InspectorTest.addObject(record.stackTrace[0], InspectorTest.timelinePropertyFormatters);
+ break;
+ }
+ }
+
+ InspectorTest.completeTest();
+ }
+}
+
+</script>
+</head>
+
+<body onload="runTest()">
+<p>
+Tests the Timeline API instrumentation of a gc event
+</p>
+</body>
+</html>
« no previous file with comments | « LayoutTests/http/tests/inspector/timeline-test.js ('k') | LayoutTests/inspector/timeline/timeline-gc-event-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698