зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1233831 - Part 5: Test the minor GC markers; r=vporof
This commit is contained in:
Родитель
6ae5801648
Коммит
926f0d1426
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче