summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/geolocation-API/getCurrentPosition_TypeError.html
blob: a2e578469793d7e86d1cc1817f2ab548bc6e91ad (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!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>