<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
<title>OffscreenCanvas test: 2d.filter.canvasFilterObject.dropShadow.exceptions.tentative</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/html/canvas/resources/canvas-tests.js"></script>

<h1>2d.filter.canvasFilterObject.dropShadow.exceptions.tentative</h1>
<p class="desc">Test exceptions on CanvasFilter() dropShadow object</p>


<script>
var t = async_test("Test exceptions on CanvasFilter() dropShadow object");
var t_pass = t.done.bind(t);
var t_fail = t.step_func(function(reason) {
    throw reason;
});
t.step(function() {

  var canvas = new OffscreenCanvas(100, 50);
  var ctx = canvas.getContext('2d');

  // dx
  _assert(new CanvasFilter({filter: 'dropShadow', dx: 10}), "new CanvasFilter({filter: 'dropShadow', dx: 10})");
  _assert(new CanvasFilter({filter: 'dropShadow', dx: -1}), "new CanvasFilter({filter: 'dropShadow', dx: -1})");
  _assert(new CanvasFilter({filter: 'dropShadow', dx: 0.5}), "new CanvasFilter({filter: 'dropShadow', dx: 0.5})");
  _assert(new CanvasFilter({filter: 'dropShadow', dx: null}), "new CanvasFilter({filter: 'dropShadow', dx: null})");
  _assert(new CanvasFilter({filter: 'dropShadow', dx: true}), "new CanvasFilter({filter: 'dropShadow', dx: true})");
  _assert(new CanvasFilter({filter: 'dropShadow', dx: false}), "new CanvasFilter({filter: 'dropShadow', dx: false})");
  _assert(new CanvasFilter({filter: 'dropShadow', dx: []}), "new CanvasFilter({filter: 'dropShadow', dx: []})");
  _assert(new CanvasFilter({filter: 'dropShadow', dx: [20]}), "new CanvasFilter({filter: 'dropShadow', dx: [\""+(20)+"\"]})");
  _assert(new CanvasFilter({filter: 'dropShadow', dx: '30'}), "new CanvasFilter({filter: 'dropShadow', dx: '30'})");
  // dy
  _assert(new CanvasFilter({filter: 'dropShadow', dy: 10}), "new CanvasFilter({filter: 'dropShadow', dy: 10})");
  _assert(new CanvasFilter({filter: 'dropShadow', dy: -1}), "new CanvasFilter({filter: 'dropShadow', dy: -1})");
  _assert(new CanvasFilter({filter: 'dropShadow', dy: 0.5}), "new CanvasFilter({filter: 'dropShadow', dy: 0.5})");
  _assert(new CanvasFilter({filter: 'dropShadow', dy: null}), "new CanvasFilter({filter: 'dropShadow', dy: null})");
  _assert(new CanvasFilter({filter: 'dropShadow', dy: true}), "new CanvasFilter({filter: 'dropShadow', dy: true})");
  _assert(new CanvasFilter({filter: 'dropShadow', dy: false}), "new CanvasFilter({filter: 'dropShadow', dy: false})");
  _assert(new CanvasFilter({filter: 'dropShadow', dy: []}), "new CanvasFilter({filter: 'dropShadow', dy: []})");
  _assert(new CanvasFilter({filter: 'dropShadow', dy: [20]}), "new CanvasFilter({filter: 'dropShadow', dy: [\""+(20)+"\"]})");
  _assert(new CanvasFilter({filter: 'dropShadow', dy: '30'}), "new CanvasFilter({filter: 'dropShadow', dy: '30'})");
  // floodOpacity
  _assert(new CanvasFilter({filter: 'dropShadow', floodOpacity: 10}), "new CanvasFilter({filter: 'dropShadow', floodOpacity: 10})");
  _assert(new CanvasFilter({filter: 'dropShadow', floodOpacity: -1}), "new CanvasFilter({filter: 'dropShadow', floodOpacity: -1})");
  _assert(new CanvasFilter({filter: 'dropShadow', floodOpacity: 0.5}), "new CanvasFilter({filter: 'dropShadow', floodOpacity: 0.5})");
  _assert(new CanvasFilter({filter: 'dropShadow', floodOpacity: null}), "new CanvasFilter({filter: 'dropShadow', floodOpacity: null})");
  _assert(new CanvasFilter({filter: 'dropShadow', floodOpacity: true}), "new CanvasFilter({filter: 'dropShadow', floodOpacity: true})");
  _assert(new CanvasFilter({filter: 'dropShadow', floodOpacity: false}), "new CanvasFilter({filter: 'dropShadow', floodOpacity: false})");
  _assert(new CanvasFilter({filter: 'dropShadow', floodOpacity: []}), "new CanvasFilter({filter: 'dropShadow', floodOpacity: []})");
  _assert(new CanvasFilter({filter: 'dropShadow', floodOpacity: [20]}), "new CanvasFilter({filter: 'dropShadow', floodOpacity: [\""+(20)+"\"]})");
  _assert(new CanvasFilter({filter: 'dropShadow', floodOpacity: '30'}), "new CanvasFilter({filter: 'dropShadow', floodOpacity: '30'})");
  // stdDeviation
  _assert(new CanvasFilter({filter: 'dropShadow', stdDeviation: 10}), "new CanvasFilter({filter: 'dropShadow', stdDeviation: 10})");
  _assert(new CanvasFilter({filter: 'dropShadow', stdDeviation: -1}), "new CanvasFilter({filter: 'dropShadow', stdDeviation: -1})");
  _assert(new CanvasFilter({filter: 'dropShadow', stdDeviation: 0.5}), "new CanvasFilter({filter: 'dropShadow', stdDeviation: 0.5})");
  _assert(new CanvasFilter({filter: 'dropShadow', stdDeviation: null}), "new CanvasFilter({filter: 'dropShadow', stdDeviation: null})");
  _assert(new CanvasFilter({filter: 'dropShadow', stdDeviation: true}), "new CanvasFilter({filter: 'dropShadow', stdDeviation: true})");
  _assert(new CanvasFilter({filter: 'dropShadow', stdDeviation: false}), "new CanvasFilter({filter: 'dropShadow', stdDeviation: false})");
  _assert(new CanvasFilter({filter: 'dropShadow', stdDeviation: []}), "new CanvasFilter({filter: 'dropShadow', stdDeviation: []})");
  _assert(new CanvasFilter({filter: 'dropShadow', stdDeviation: [20]}), "new CanvasFilter({filter: 'dropShadow', stdDeviation: [\""+(20)+"\"]})");
  _assert(new CanvasFilter({filter: 'dropShadow', stdDeviation: '30'}), "new CanvasFilter({filter: 'dropShadow', stdDeviation: '30'})");
  _assert(new CanvasFilter({filter: 'dropShadow', stdDeviation: [10, -1]}), "new CanvasFilter({filter: 'dropShadow', stdDeviation: [10, -1]})");
  _assert(new CanvasFilter({filter: 'dropShadow', stdDeviation: [0.5, null]}), "new CanvasFilter({filter: 'dropShadow', stdDeviation: [0.5, null]})");
  _assert(new CanvasFilter({filter: 'dropShadow', stdDeviation: [true, false]}), "new CanvasFilter({filter: 'dropShadow', stdDeviation: [true, false]})");
  _assert(new CanvasFilter({filter: 'dropShadow', stdDeviation: [[], [20]]}), "new CanvasFilter({filter: 'dropShadow', stdDeviation: [[], [\""+(20)+"\"]]})");
  _assert(new CanvasFilter({filter: 'dropShadow', stdDeviation: ['30', ['40']]}), "new CanvasFilter({filter: 'dropShadow', stdDeviation: ['30', ['40']]})");
  // floodColor
  _assert(new CanvasFilter({filter: 'dropShadow', floodColor: 'red'}), "new CanvasFilter({filter: 'dropShadow', floodColor: 'red'})");
  _assert(new CanvasFilter({filter: 'dropShadow', floodColor: 'canvas'}), "new CanvasFilter({filter: 'dropShadow', floodColor: 'canvas'})");
  _assert(new CanvasFilter({filter: 'dropShadow', floodColor: 'rgba(4, -3, 0.5, 1)'}), "new CanvasFilter({filter: 'dropShadow', floodColor: 'rgba(4, -3, 0.5, 1)'})");
  _assert(new CanvasFilter({filter: 'dropShadow', floodColor: '#aabbccdd'}), "new CanvasFilter({filter: 'dropShadow', floodColor: '#aabbccdd'})");
  _assert(new CanvasFilter({filter: 'dropShadow', floodColor: '#abcd'}), "new CanvasFilter({filter: 'dropShadow', floodColor: '#abcd'})");

  // dx
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', dx: NaN}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', dx: Infinity}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', dx: -Infinity}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', dx: undefined}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', dx: 'test'}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', dx: {}}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', dx: [1, 2]}); });
  // dy
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', dy: NaN}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', dy: Infinity}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', dy: -Infinity}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', dy: undefined}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', dy: 'test'}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', dy: {}}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', dy: [1, 2]}); });
  // floodOpacity
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', floodOpacity: NaN}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', floodOpacity: Infinity}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', floodOpacity: -Infinity}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', floodOpacity: undefined}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', floodOpacity: 'test'}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', floodOpacity: {}}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', floodOpacity: [1, 2]}); });
  // stdDeviation
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', stdDeviation: NaN}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', stdDeviation: Infinity}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', stdDeviation: -Infinity}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', stdDeviation: undefined}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', stdDeviation: 'test'}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', stdDeviation: {}}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', stdDeviation: [1, 2, 3]}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', stdDeviation: [1, NaN]}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', stdDeviation: [1, Infinity]}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', stdDeviation: [1, -Infinity]}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', stdDeviation: [1, undefined]}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', stdDeviation: [1, 'test']}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', stdDeviation: [1, {}]}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', stdDeviation: [1, [2, 3]]}); });
  // floodColor
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', floodColor: 'test'}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', floodColor: 'rgba(NaN, 3, 2, 1)'}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', floodColor: 10}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', floodColor: undefined}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', floodColor: null}); });
  assert_throws_js(TypeError, function() { new CanvasFilter({filter: 'dropShadow', floodColor: NaN}); });
  t.done();

});
</script>
