Bug 1233831 - Part 5: Test the minor GC markers; r=vporof

This commit is contained in:
Nick Fitzgerald 2016-01-19 12:48:23 -08:00
Родитель 6ae5801648
Коммит 926f0d1426
3 изменённых файлов: 37 добавлений и 2 удалений

Просмотреть файл

@ -54,6 +54,7 @@ skip-if = e10s # Bug 1183605 - devtools/server/tests/browser/ tests are still di
[browser_markers-docloading-02.js]
[browser_markers-docloading-03.js]
[browser_markers-gc.js]
[browser_markers-minor-gc.js]
[browser_markers-parse-html.js]
[browser_markers-styles.js]
[browser_markers-timestamp.js]

Просмотреть файл

@ -0,0 +1,32 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Test that we get "MinorGC" markers when we continue to steadily allocate
* objects.
*/
const { PerformanceFront } = require("devtools/server/actors/performance");
add_task(function*() {
// This test runs very slowly on linux32 debug EC2 instances.
requestLongerTimeout(2);
let doc = yield addTab(MAIN_DOMAIN + "doc_allocations.html");
initDebuggerServer();
let client = new DebuggerClient(DebuggerServer.connectPipe());
let form = yield connectDebuggerClient(client);
let front = PerformanceFront(client, form);
yield front.connect();
let rec = yield front.startRecording({ withMarkers: true });
let markers = yield waitForMarkerType(front, ["MinorGC"]);
yield front.stopRecording(rec);
ok(markers.some(m => m.name === "MinorGC" && m.causeName),
"got some MinorGC markers");
yield closeDebuggerClient(client);
gBrowser.removeCurrentTab();
});

Просмотреть файл

@ -5,10 +5,12 @@
</head>
<body>
<script>
window.allocs = [];
window.onload = function() {
var allocs = [];
function allocator() {
allocs.push(new Object);
for (var i = 0; i < 1000; i++) {
window.allocs.push(new Object);
}
}
window.setInterval(allocator, 1);