https://github.com/web-platform-tests/wpt
Raw File
Tip revision: c2b8c888626597462c9e9261aa1bedd4c4edb850 authored by Frédéric Wang on 27 June 2018, 07:37:03 UTC
Convert to manual test, add a version where the click happens from a subframe
Tip revision: c2b8c88
getCurrentPosition_TypeError.html
<!DOCTYPE HTML>
<meta charset='utf-8'>
<title>Geolocation Test: getCurrentPosition 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?00027
test(function() {
  assert_throws(new TypeError(), function() {
    geo.getCurrentPosition();
  });
}, 'Call getCurrentPosition without arguments, check that exception is thrown');

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

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

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

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

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

done();
</script>
back to top