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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame.js

Issue 2667393002: Stop using script-tests in fast/dom/. (Closed)
Patch Set: . Created 3 years, 10 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 when a request is made on a Geolocation object and its F rame is disconnected before a callback is made, no callbacks are made.");
2
3 var error;
4 var iframe = document.createElement('iframe');
5
6 function onIframeLoaded() {
7 iframeGeolocation = iframe.contentWindow.navigator.geolocation;
8 iframe.src = 'data:text/html,This frame should be visible when the test comp letes';
9 }
10
11 function onIframeUnloaded() {
12 iframeGeolocation.getCurrentPosition(function () {
13 testFailed('Success callback invoked unexpectedly');
14 finishJSTest();
15 }, function(e) {
16 testFailed('Error callback invoked unexpectedly');
17 finishJSTest();
18 });
19 setTimeout(function() {
20 testPassed('No callbacks invoked');
21 finishJSTest();
22 }, 100);
23 }
24
25 geolocationServiceMock.then(mock => {
26 mock.setGeolocationPermission(true);
27 mock.setGeolocationPosition(51.478, -0.166, 100);
28
29 iframe.src = 'resources/disconnected-frame-inner.html';
30 document.body.appendChild(iframe);
31 });
32
33 window.jsTestIsAsync = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698