summaryrefslogtreecommitdiffstats
path: root/devtools/server/tests/chrome/test_framerate_03.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
commit2aa4a82499d4becd2284cdb482213d541b8804dd (patch)
treeb80bf8bf13c3766139fbacc530efd0dd9d54394c /devtools/server/tests/chrome/test_framerate_03.html
parentInitial commit. (diff)
downloadfirefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz
firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/server/tests/chrome/test_framerate_03.html')
-rw-r--r--devtools/server/tests/chrome/test_framerate_03.html51
1 files changed, 51 insertions, 0 deletions
diff --git a/devtools/server/tests/chrome/test_framerate_03.html b/devtools/server/tests/chrome/test_framerate_03.html
new file mode 100644
index 0000000000..b8eca6c428
--- /dev/null
+++ b/devtools/server/tests/chrome/test_framerate_03.html
@@ -0,0 +1,51 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+Bug 1023018 - Tests whether or not the framerate actor can handle time ranges.
+-->
+<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";
+
+const START_TICK = 2000;
+const STOP_TICK = 3000;
+const TOTAL_TIME = 5000;
+
+window.onload = async function() {
+ const target = await getTargetForSelectedTab();
+ const front = await target.getFront("framerate");
+
+ await front.startRecording();
+ await waitFor(TOTAL_TIME);
+ const rawData = await front.stopRecording(START_TICK, STOP_TICK);
+ await onRecordingStopped(front, rawData);
+ await target.destroy();
+ SimpleTest.finish();
+};
+
+// Local Helper Functions
+async function onRecordingStopped(front, rawData) {
+ ok(rawData, "There should be a recording available.");
+
+ ok(!rawData.find(e => e < START_TICK),
+ "There should be no tick before 2000ms.");
+ ok(!rawData.find(e => e > STOP_TICK),
+ "There should be no tick after 3000ms.");
+
+ for (const tick of rawData) {
+ info("Testing tick: " + tick);
+ is(typeof tick, "number", "All values should be numbers.");
+ }
+}
+</script>
+</pre>
+</body>
+</html>