2d.canvas.context.extraargs.cache.html (1490B)
1 <!DOCTYPE html> 2 <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> 3 <meta charset="UTF-8"> 4 <title>OffscreenCanvas test: 2d.canvas.context.extraargs.cache</title> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <script src="/html/canvas/resources/canvas-tests.js"></script> 8 9 <h1>2d.canvas.context.extraargs.cache</h1> 10 <p class="desc">The 2D context doesn't throw with extra getContext arguments (cached)</p> 11 12 13 <script> 14 var t = async_test("The 2D context doesn't throw with extra getContext arguments (cached)"); 15 var t_pass = t.done.bind(t); 16 var t_fail = t.step_func(function(reason) { 17 throw reason; 18 }); 19 t.step(function() { 20 21 var canvas = new OffscreenCanvas(100, 50); 22 var ctx = canvas.getContext('2d'); 23 24 _assertDifferent(canvas.getContext('2d', false, {}, [], 1, '2'), null, "canvas.getContext('2d', false, {}, [], 1, '2')", "null"); 25 _assertDifferent(canvas.getContext('2d', 123), null, "canvas.getContext('2d', 123)", "null"); 26 _assertDifferent(canvas.getContext('2d', 'test'), null, "canvas.getContext('2d', 'test')", "null"); 27 _assertDifferent(canvas.getContext('2d', undefined), null, "canvas.getContext('2d', undefined)", "null"); 28 _assertDifferent(canvas.getContext('2d', null), null, "canvas.getContext('2d', null)", "null"); 29 _assertDifferent(canvas.getContext('2d', Symbol.hasInstance), null, "canvas.getContext('2d', Symbol.hasInstance)", "null"); 30 t.done(); 31 32 }); 33 </script>