Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/cached-position-iframe.js

Issue 1948033003: Convert most geolocation layout tests to use a JS mock implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permission-disconnect
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 description('Tests that a cached position can be obtained in one frame after ano ther frame has received a fresh position.');
2
3 if (!window.testRunner || !window.internals)
4 debug('This test can not run without testRunner or internals');
5
6 internals.setGeolocationClientMock(document);
7 internals.setGeolocationPosition(document, 51.478, -0.166, 100);
8 internals.setGeolocationPermission(document, true);
9
10 window.onmessage = function (messageEvent) {
11 debug(messageEvent.data.message);
12 success = messageEvent.data.success;
13 shouldBeTrue('success');
14 finishJSTest();
15 }
16
17 navigator.geolocation.getCurrentPosition(
18 function() {
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);
24 });
25
26 window.jsTestIsAsync = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698