gecko-dev/browser/devtools/performance/test/browser_perf-front-basic-profiler-01.js
Patrick Brosset f74b4d25f0 Bug 1168077 - Remove remaining spidermonkey js specific syntax from browser/devtools; r=miker
--HG--
extra : rebase_source : 15f48894284051c2f10d9b71c94d7074f893002a
2015-05-25 14:42:51 +02:00

33 lines
1.0 KiB
JavaScript

/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Test basic functionality of PerformanceFront
*/
let WAIT_TIME = 1000;
function* spawnTest() {
let { target, front } = yield initBackend(SIMPLE_URL);
let startModel = yield front.startRecording();
let { profilerStartTime, timelineStartTime, memoryStartTime } = startModel;
ok(startModel._profilerStartTime !== undefined,
"A `_profilerStartTime` property exists in the recording model.");
ok(startModel._timelineStartTime !== undefined,
"A `_timelineStartTime` property exists in the recording model.");
is(startModel._memoryStartTime, 0,
"A `_memoryStartTime` property exists in the recording model, but it's 0.");
yield busyWait(WAIT_TIME);
let stopModel = yield front.stopRecording(startModel);
ok(stopModel.getProfile(), "recording model has a profile after stopping.");
ok(stopModel.getDuration(), "recording model has a duration after stopping.");
yield removeTab(target.tab);
finish();
}