summaryrefslogtreecommitdiffstats
path: root/devtools/server/tests/chrome/test_framerate_05.html
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/server/tests/chrome/test_framerate_05.html')
-rw-r--r--devtools/server/tests/chrome/test_framerate_05.html47
1 files changed, 47 insertions, 0 deletions
diff --git a/devtools/server/tests/chrome/test_framerate_05.html b/devtools/server/tests/chrome/test_framerate_05.html
new file mode 100644
index 0000000000..574b86719a
--- /dev/null
+++ b/devtools/server/tests/chrome/test_framerate_05.html
@@ -0,0 +1,47 @@
+<!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>