summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/delegated-ink/exception-thrown-diameter-less-than-or-equal-to-0.tentative.html
blob: bf26ab1cffce8b3b6773e328978c6ed05f6f9ca0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>

<canvas id="canvas"></canvas>
<script>
  function RunTest(d, move) {
    promise_test(async (t) => {
      const presenter = await navigator.ink.requestPresenter({presentationArea: canvas});
      const style = { color: "green", diameter: d };

      canvas.addEventListener("pointermove", evt => {
        assert_equals(d, style.diameter);
        assert_throws_dom("NotSupportedError", function() {
          presenter.updateInkTrailStartPoint(evt, style);
        }, "Expected a NotSupportedError to be thrown due to diameter set to "+d+".");
      });

      const actions_promise = new test_driver.Actions().pointerMove(move, move).send();
      t.add_cleanup(() => actions_promise);
    });
  }

  RunTest(0, 10);
  RunTest(-0.000001, 11);
  RunTest(-1, 10);
  RunTest(-100, 11);
</script>