dom/workers/test/test_timeoutTracing.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/workers/test/test_timeoutTracing.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,47 @@
     1.4 +<!--
     1.5 +  Any copyright is dedicated to the Public Domain.
     1.6 +  http://creativecommons.org/publicdomain/zero/1.0/
     1.7 +-->
     1.8 +<!DOCTYPE HTML>
     1.9 +<html>
    1.10 +<!--
    1.11 +Tests of DOM Worker Threads
    1.12 +-->
    1.13 +<head>
    1.14 +  <title>Test for DOM Worker Threads</title>
    1.15 +  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.16 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    1.17 +</head>
    1.18 +<body>
    1.19 +<pre id="test">
    1.20 +<script class="testbody" type="text/javascript">
    1.21 +
    1.22 +  var worker = new Worker("timeoutTracing_worker.js");
    1.23 +
    1.24 +  worker.onmessage = function(event) {
    1.25 +    // begin
    1.26 +    worker.onmessage = null;
    1.27 +
    1.28 +    // 1 second should be enough to crash.
    1.29 +    window.setTimeout(function(event) {
    1.30 +      ok(true, "Didn't crash!");
    1.31 +      SimpleTest.finish();
    1.32 +    }, 1000);
    1.33 +
    1.34 +    var os = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
    1.35 +                          .getService(SpecialPowers.Ci.nsIObserverService);
    1.36 +    os.notifyObservers(null, "memory-pressure", "heap-minimize");
    1.37 +  }
    1.38 +
    1.39 +  worker.onerror = function(event) {
    1.40 +    ok(false, "I was expecting a crash, not an error");
    1.41 +    SimpleTest.finish();
    1.42 +  };
    1.43 +
    1.44 +  SimpleTest.waitForExplicitFinish();
    1.45 +
    1.46 +</script>
    1.47 +</pre>
    1.48 +</body>
    1.49 +</html>
    1.50 +

mercurial