Bug 628949 - Update visible region / glass regions after we paint. r=roc a=2.0.
[mozilla-central.git] / toolkit / xre / test / test_fpuhandler.html
blobc141293795a8b025b846d2d2ef76dfbf2f5a2b9e
1 <head>
2 <title>Floating-point exception handler test</title>
3 <script type="application/javascript" src="/MochiKit/packed.js"></script>
4 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
6 <body onload="runTest()">
7 <embed id="plugin1" type="application/x-test" width="400" height="400"></embed>
9 <script class="testbody" type="application/javascript">
10 SimpleTest.waitForExplicitFinish();
12 function doDiv(x, y) {
13 var z;
14 z = x / y;
16 for (i = 0 + x; i < 1000; ++i)
17 z = y / x;
19 z = x / y;
20 return z;
23 function runTest()
25 ok(isNaN(doDiv(0.0, 0.0)), "Undefined division-by-zero doesn't crash");
27 try {
28 document.getElementById('plugin1').enableFPExceptions();
30 catch (e) {
31 ok(true, "No special code to set the FPU bit in the testplugin.");
32 SimpleTest.finish();
33 return;
36 ok(isNaN(doDiv(0.0, 0.0)), "Undefined division-by-zero doesn't crash again.");
37 SimpleTest.finish();
39 </script>