https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 8ee803e171bc0b0d5e93bebd4a56e3200f08421d authored by Chris Rebert on 29 December 2016, 03:02:36 UTC
Add test for MouseEvent.toElement & MouseEvent.fromElement
Tip revision: 8ee803e
watchPosition_TypeError.html
<!DOCTYPE HTML>
<meta charset='utf-8'>
<title>Geolocation Test: watchPosition TypeError tests</title>
<link rel='help' href='http://www.w3.org/TR/geolocation-API/'>
<script src='/resources/testharness.js'></script>
<script src='/resources/testharnessreport.js'></script>
<script src='support.js'></script>

<div id='log'></div>

<script>
// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00058
test(function() {
  assert_throws(new TypeError(), function() {
    geo.watchPosition();
  });
}, 'Call watchPosition without arguments, check that exception is thrown');

// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00015
test(function() {
  assert_throws(new TypeError(), function() {
    geo.watchPosition(null);
  });
}, 'Call watchPosition with null success callback, check that exception is thrown');

// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00017
test(function() {
  assert_throws(new TypeError(), function() {
    geo.watchPosition(null, null);
  });
}, 'Call watchPosition with null success and error callbacks, check that exception is thrown');

// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00059
test(function() {
  assert_throws(new TypeError(), function() {
    geo.watchPosition(3);
  });
}, 'Call watchPosition() with wrong type for first argument. Exception expected.');

// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00060
test(function() {
  assert_throws(new TypeError(), function() {
    geo.watchPosition(dummyFunction, 4);
  });
}, 'Call watchPosition() with wrong type for second argument. Exception expected.');

// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00061
test(function() {
  assert_throws(new TypeError(), function() {
    geo.watchPosition(dummyFunction, dummyFunction, 4);
  });
}, 'Call watchPosition() with wrong type for third argument. Exception expected.');

done();
</script>
back to top