1 description('Tests that a cached position can be obtained in one frame after another frame has received a fresh position.');
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);
8 internals.setGeolocationPermission(document, true);
10 window.onmessage = function (messageEvent) {
11 debug(messageEvent.data.message);
12 success = messageEvent.data.success;
13 shouldBeTrue('success');
17 navigator.geolocation.getCurrentPosition(
19 // Kick off the iframe to request a cached position. The iframe
20 // will post a message back on success / failure.
21 iframe = document.createElement('iframe');
22 iframe.src = 'resources/cached-position-iframe-inner.html';
23 document.body.appendChild(iframe);
26 window.jsTestIsAsync = true;