tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

context-lost-worker.html (987B)


      1 <!--
      2 Copyright (c) 2019 The Khronos Group Inc.
      3 Use of this source code is governed by an MIT-style license that can be
      4 found in the LICENSE.txt file.
      5 -->
      6 <!DOCTYPE html>
      7 <html>
      8 <head>
      9 <meta charset="utf-8">
     10 <link rel="stylesheet" href="../../resources/js-test-style.css"/>
     11 <script src="../../js/js-test-pre.js"></script>
     12 <script src="../../js/webgl-test-utils.js"></script>
     13 <script>
     14 function init()
     15 {
     16  description("Tests behavior under a lost context for OffscreenCanvas in a worker");
     17 
     18  if (!window.OffscreenCanvas) {
     19    testPassed("No OffscreenCanvas support");
     20    finishTest();
     21    return;
     22  }
     23 
     24  var worker = new Worker('context-lost-worker.js');
     25  worker.postMessage("Start worker");
     26  worker.onmessage = function(e) {
     27    const fn = e.data.fail ? testFailed : testPassed;
     28    fn(e.data.msg);
     29    if (e.data.finishTest) {
     30      finishTest();
     31    }
     32    return;
     33  }
     34 }
     35 
     36 </script>
     37 </head>
     38 <body onload="init()">
     39 <div id="description"></div>
     40 <div id="console"></div>
     41 </body>
     42 </html>