exception-thrown-diameter-less-than-or-equal-to-0.tentative.html (1080B)
1 <!DOCTYPE html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <script src="/resources/testdriver.js"></script> 5 <script src="/resources/testdriver-actions.js"></script> 6 <script src="/resources/testdriver-vendor.js"></script> 7 8 <canvas id="canvas"></canvas> 9 <script> 10 function RunTest(d, move) { 11 promise_test(async (t) => { 12 const presenter = await navigator.ink.requestPresenter({presentationArea: canvas}); 13 const style = { color: "green", diameter: d }; 14 15 canvas.addEventListener("pointermove", evt => { 16 assert_equals(d, style.diameter); 17 assert_throws_dom("NotSupportedError", function() { 18 presenter.updateInkTrailStartPoint(evt, style); 19 }, "Expected a NotSupportedError to be thrown due to diameter set to "+d+"."); 20 }); 21 22 const actions_promise = new test_driver.Actions().pointerMove(move, move).send(); 23 t.add_cleanup(() => actions_promise); 24 }); 25 } 26 27 RunTest(0, 10); 28 RunTest(-0.000001, 11); 29 RunTest(-1, 10); 30 RunTest(-100, 11); 31 </script>