methods-worker.html (1057B)
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 <title>WebGL Methods Test for OffscreenCanvas in a worker</title> 11 <link rel="stylesheet" href="../../resources/js-test-style.css"/> 12 <script src="../../js/js-test-pre.js"></script> 13 <script src="../../js/webgl-test-utils.js"></script> 14 </head> 15 <body> 16 <div id="description"></div> 17 <div id="console"></div> 18 <script> 19 description("This test ensures that the WebGL context created for an OffscreenCanvas has all the methods in the specification."); 20 21 if (!window.OffscreenCanvas) { 22 testPassed("No OffscreenCanvas support"); 23 finishTest(); 24 } else { 25 var worker = new Worker("methods-worker.js"); 26 worker.postMessage("Start worker"); 27 worker.onmessage = function(e) { 28 if (e.data == "Test passed") { 29 testPassed("All tests have passed"); 30 } else { 31 testFailed("Some tests failed"); 32 } 33 finishTest(); 34 } 35 } 36 37 </script> 38 </body> 39 </html>