зеркало из https://github.com/mozilla/gecko-dev.git
48 строки
1.2 KiB
HTML
48 строки
1.2 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<!--
|
|
Bug 1034648 - Tests whether a framerate recording can be cancelled.
|
|
-->
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Framerate actor test</title>
|
|
<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
|
<script type="application/javascript" src="framerate-helpers.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
|
|
</head>
|
|
<body>
|
|
<pre id="test">
|
|
<script>
|
|
"use strict";
|
|
|
|
window.onload = async function() {
|
|
const target = await getTargetForSelectedTab();
|
|
const front = await target.getFront("framerate");
|
|
const TICK = 1000;
|
|
|
|
await front.startRecording();
|
|
await waitFor(TICK);
|
|
|
|
await front.cancelRecording();
|
|
await waitFor(TICK);
|
|
|
|
const rawTicks = await front.getPendingTicks();
|
|
ok(rawTicks,
|
|
"The returned pending ticks should be empty (1).");
|
|
is(rawTicks.length, 0,
|
|
"The returned pending ticks should be empty (2).");
|
|
|
|
const newRawData = await front.stopRecording();
|
|
ok(newRawData,
|
|
"The returned raw data should be an empty array (1).");
|
|
is(newRawData.length, 0,
|
|
"The returned raw data should be an empty array (2).");
|
|
|
|
await target.destroy();
|
|
SimpleTest.finish();
|
|
};
|
|
</script>
|
|
</pre>
|
|
</body>
|
|
</html>
|