mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:18:48 +00:00
45b8007f3d
- Bug 1150717 - Test request with no params in the Network Monitor. r=brings (a60e9e8d9) - Bug 1168077 - Remove remaining spidermonkey js specific syntax from browser/devtools; r=miker (c98f20c30) - Bug 1168125 - Fix existing tests, r=jsantell (b1dfa101e) - Bug 1169439 - Pull out marker definitions into its own file, and move formatter and collapse functions into marker-utils. r=vp (17eb24ab3) - Bug 1173654 - Part 1: Add logging methods for SurfaceType and ImageFormat. r=Bas (22f2fa019) - Bug 1169125 - Part 1: Allow sending any DataSourceSurface-backed image over WebRTC and fix failure cases. r=bwc (1fb0def92) - Bug 1169125 - Part 2: Use UniquePtr for scoped delete of yuv data in MediaPipeline. r=bwc (cdb79e201) - Bug 1173654 - Part 2: Use namespaces in MediaPipeline.cpp. r=bwc (311696260) - Bug 1173654 - Part 3: Attempt to GetDataSurface() and convert if sending pure I420 fails. r=bwc, r=jesup (58520b820) - Bug 1173654 - Part 4: Add detailed logging and asserts to MediaPipeline::ProcessVideoChunk. r=bwc (ba08ae5bc) - Bug 1155089 - Part 1: Reset |TrackID| for MediaPipelineTransmit::PipelineListener on replaceTrack(). r=bwc (304fb8703) - adapted Bug 1142688 - Wait for actual audio data on remote side before checking audio sanity. r=jesup,padenot (479f6356c) - Bug 858927 - Move the mozilla::TimeStamp into mozglue. r=glandium (751938e09) - Bug 1166559 - Add documentation for ProfileTimelineMarkers from a dev tools perspective. r=fitzgen (ed1563dfb) - Bug 1141614 - Part 4: Expose cycle collection markers in the devtools frontend; r=jsantell (2eb830de7)
85 lines
2.6 KiB
JavaScript
85 lines
2.6 KiB
JavaScript
/* Any copyright is dedicated to the Public Domain.
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
/**
|
|
* Test basic functionality of PerformanceFront, retrieving timeline data.
|
|
*/
|
|
|
|
function* spawnTest() {
|
|
let { target, front } = yield initBackend(SIMPLE_URL);
|
|
|
|
let lastMemoryDelta = 0;
|
|
let lastTickDelta = 0;
|
|
|
|
let counters = {
|
|
markers: [],
|
|
memory: [],
|
|
ticks: []
|
|
};
|
|
|
|
let deferreds = {
|
|
markers: Promise.defer(),
|
|
memory: Promise.defer(),
|
|
ticks: Promise.defer()
|
|
};
|
|
|
|
front.on("timeline-data", handler);
|
|
|
|
yield front.startRecording({ withMarkers: true, withMemory: true, withTicks: true });
|
|
yield Promise.all(Object.keys(deferreds).map(type => deferreds[type].promise));
|
|
yield front.stopRecording();
|
|
front.off("timeline-data", handler);
|
|
|
|
is(counters.markers.length, 1, "one marker event fired.");
|
|
is(counters.memory.length, 3, "three memory events fired.");
|
|
is(counters.ticks.length, 3, "three ticks events fired.");
|
|
|
|
yield removeTab(target.tab);
|
|
finish();
|
|
|
|
function handler (_, name, ...args) {
|
|
if (name === "markers") {
|
|
if (counters.markers.length >= 1) { return; }
|
|
let [markers] = args;
|
|
ok(markers[0].start, "received atleast one marker with `start`");
|
|
ok(markers[0].end, "received atleast one marker with `end`");
|
|
ok(markers[0].name, "received atleast one marker with `name`");
|
|
|
|
counters.markers.push(markers);
|
|
}
|
|
else if (name === "memory") {
|
|
if (counters.memory.length >= 3) { return; }
|
|
let [delta, measurement] = args;
|
|
is(typeof delta, "number", "received `delta` in memory event");
|
|
ok(delta > lastMemoryDelta, "received `delta` in memory event");
|
|
ok(measurement.total, "received `total` in memory event");
|
|
|
|
counters.memory.push({ delta, measurement });
|
|
lastMemoryDelta = delta;
|
|
}
|
|
else if (name === "ticks") {
|
|
if (counters.ticks.length >= 3) { return; }
|
|
let [delta, timestamps] = args;
|
|
ok(delta > lastTickDelta, "received `delta` in ticks event");
|
|
|
|
// Timestamps aren't guaranteed to always contain tick events, since
|
|
// they're dependent on the refresh driver, which may be blocked.
|
|
|
|
counters.ticks.push({ delta, timestamps });
|
|
lastTickDelta = delta;
|
|
}
|
|
else if (name === "frames") {
|
|
// Nothing to do here.
|
|
}
|
|
else {
|
|
ok(false, `Received unknown event: ${name}`);
|
|
}
|
|
|
|
if (name === "markers" && counters[name].length === 1 ||
|
|
name === "memory" && counters[name].length === 3 ||
|
|
name === "ticks" && counters[name].length === 3) {
|
|
deferreds[name].resolve();
|
|
}
|
|
};
|
|
}
|