Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / Geolocation / script-tests / timeout-negative.js
blob137bc8e27dbc7746129c98e5c959a775d99274bb
1 description("Tests that when timeout is negative (and maximumAge is too), the error callback is called immediately with code TIMEOUT.");
3 if (!window.testRunner || !window.internals)
4 debug('This test can not run without testRunner or internals');
6 internals.setGeolocationClientMock(document);
7 internals.setGeolocationPosition(document, 51.478, -0.166, 100.0);
9 var error;
10 navigator.geolocation.getCurrentPosition(function(p) {
11 testFailed('Success callback invoked unexpectedly');
12 finishJSTest();
13 }, function(e) {
14 error = e;
15 shouldBe('error.code', 'error.TIMEOUT');
16 shouldBe('error.message', '"Timeout expired"');
17 finishJSTest();
18 }, {
19 timeout: -1000
20 });
22 window.jsTestIsAsync = true;