1 <!-- Any copyright is dedicated to the Public Domain.
2 - http://creativecommons.org/publicdomain/zero/1.0/ -->
6 <title>PerformanceResouceTiming in workers
</title>
7 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
8 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
11 <script class=
"testbody" type=
"text/javascript">
13 SimpleTest.waitForExplicitFinish();
15 // The worker assumes it will take some amount of time to load a resource.
16 // With a low enough precision, the duration to load a resource may clamp
18 var reduceTimePrecisionPrevPrefValue = SpecialPowers.getBoolPref(
"privacy.reduceTimerPrecision");
19 SpecialPowers.setBoolPref(
"privacy.reduceTimerPrecision", false);
21 var worker = new Worker('test_worker_performance_entries.js');
22 worker.onmessage = function(event) {
23 if (event.data.type ==
"check") {
24 ok(event.data.status, event.data.msg);
28 if (event.data.type ==
"finish") {
29 SpecialPowers.setBoolPref(
"privacy.reduceTimerPrecision", reduceTimePrecisionPrevPrefValue);