Bug 1924993 - [devtools] Debugger tests wait before typing in conditional panel r...
[gecko.git] / tools / profiler / tests / chrome / test_profile_worker_bug_1428076.html
blobabe0e5748a0a69a1a0aa04e018b98311dba52908
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=1428076
5 -->
6 <head>
7 <meta charset="utf-8">
8 <title>Test for Bug 1428076</title>
9 <link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
10 <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
11 </head>
12 <body>
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1428076">Mozilla Bug 1428076</a>
15 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
16 <script type="application/javascript" src="profiler_test_utils.js"></script>
17 <script type="application/javascript">
18 /** Test for Bug 1428076 **/
20 /* globals runTest */
22 "use strict";
24 const settings = {
25 entries: 1000000, // 9MB
26 interval: 1, // ms
27 features: ["js", "stackwalk"],
28 threads: ["GeckoMain", "Compositor", "Worker"], // most common combination
31 function workload() {
32 // We use a Blob for the worker content to avoid an external JS file, and data
33 // URLs seem to be blocked in a chrome environment.
34 const workerContent = new Blob(
35 [ "console.log('hello world!')" ],
36 { type: "application/javascript" }
38 const blobURL = URL.createObjectURL(workerContent);
40 // We start a worker and then terminate it right away to trigger our bug.
41 info("Starting the worker, and terminate it right away.");
42 const myWorker = new Worker(blobURL);
43 myWorker.terminate();
45 URL.revokeObjectURL(blobURL);
47 // We're deferring some little time so that the worker has the time to be
48 // properly cleaned up and the profiler actually saves the worker data.
49 return new Promise(resolve => {
50 setTimeout(resolve, 50);
51 });
54 runTest(settings, workload);
56 </script>
57 </body>
58 </html>