blob: 9a3a5d398da988999bd984afe53943f212095533 [file] [log] [blame]
[email protected]344a13d2010-08-16 12:30:051<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2<html>
3<head>
tkentc5e88f02017-02-06 22:47:314<script src="../resources/js-test.js"></script>
Reilly Grantbe310ab2017-07-11 01:51:265<script src="file:///gen/layout_test_data/mojo/public/js/mojo_bindings.js"></script>
6<script src="file:///gen/device/geolocation/public/interfaces/geolocation.mojom.js"></script>
7<script src="file:///gen/third_party/WebKit/public/platform/modules/permissions/permission.mojom.js"></script>
sammce6687802016-05-13 04:06:578<script src="resources/geolocation-mock.js"></script>
[email protected]344a13d2010-08-16 12:30:059</head>
10<body>
tkent98122ee2017-02-02 07:38:5111<script>
12description("Tests that when a request is made on a Geolocation object and its Frame is disconnected before a callback is made, no callbacks are made.");
13
14var error;
15var iframe = document.createElement('iframe');
16
17function onIframeLoaded() {
18 iframeGeolocation = iframe.contentWindow.navigator.geolocation;
19 iframe.src = 'data:text/html,This frame should be visible when the test completes';
20}
21
22function onIframeUnloaded() {
23 iframeGeolocation.getCurrentPosition(function () {
24 testFailed('Success callback invoked unexpectedly');
25 finishJSTest();
26 }, function(e) {
27 testFailed('Error callback invoked unexpectedly');
28 finishJSTest();
29 });
30 setTimeout(function() {
31 testPassed('No callbacks invoked');
32 finishJSTest();
33 }, 100);
34}
35
tkent98122ee2017-02-02 07:38:5136
Reilly Grantbe310ab2017-07-11 01:51:2637let mock = geolocationMock;
38mock.setGeolocationPermission(true);
39mock.setGeolocationPosition(51.478, -0.166, 100);
40
41iframe.src = 'resources/disconnected-frame-inner.html';
42document.body.appendChild(iframe);
tkent98122ee2017-02-02 07:38:5143
44window.jsTestIsAsync = true;
45</script>
[email protected]344a13d2010-08-16 12:30:0546</body>
47</html>