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

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

Issue 1367853002: Move GeolocationDispatcher into blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
1 description("Tests that when a request is made on a Geolocation object after its frame has been disconnected, no callbacks are made and no crash occurs."); 1 description("Tests that when a request is made on a Geolocation object after its frame has been disconnected, no callbacks are made and no crash occurs.");
2 2
3 if (!window.testRunner || !window.internals) 3 if (!window.testRunner || !window.mojo)
4 debug('This test can not run without testRunner or internals'); 4 debug('This test can not run without testRunner or mojo');
5 5
6 internals.setGeolocationClientMock(document); 6 var iframe = document.createElement('iframe');
7 internals.setGeolocationPermission(document, true); 7
8 internals.setGeolocationPosition(document, 51.478, -0.166, 100); 8 geolocationServiceMock.then(mock => {
9 mock.setGeolocationPermission(true);
10 mock.setGeolocationPosition(51.478, -0.166, 100);
11
12 iframe.src = 'resources/disconnected-frame-already-inner1.html';
13 document.body.appendChild(iframe);
14 });
9 15
10 function onFirstIframeLoaded() { 16 function onFirstIframeLoaded() {
11 iframeGeolocation = iframe.contentWindow.navigator.geolocation; 17 iframeGeolocation = iframe.contentWindow.navigator.geolocation;
12 iframe.src = 'resources/disconnected-frame-already-inner2.html'; 18 iframe.src = 'resources/disconnected-frame-already-inner2.html';
13 } 19 }
14 20
15 var error;
16 function onSecondIframeLoaded() { 21 function onSecondIframeLoaded() {
17 iframeGeolocation.getCurrentPosition(function () { 22 iframeGeolocation.getCurrentPosition(function () {
18 testFailed('Success callback invoked unexpectedly'); 23 testFailed('Success callback invoked unexpectedly');
19 finishJSTest(); 24 finishJSTest();
20 }, function(e) { 25 }, function(e) {
21 testFailed('Error callback invoked unexpectedly'); 26 testFailed('Error callback invoked unexpectedly');
22 finishJSTest(); 27 finishJSTest();
23 }); 28 });
24 setTimeout(finishTest, 1000); 29 setTimeout(finishTest, 1000);
25 } 30 }
26 31
27 function finishTest() { 32 function finishTest() {
28 debug('Method called on Geolocation object with disconnected Frame.'); 33 debug('Method called on Geolocation object with disconnected Frame.');
29 finishJSTest(); 34 finishJSTest();
30 } 35 }
31 36
32 var iframe = document.createElement('iframe');
33 iframe.src = 'resources/disconnected-frame-already-inner1.html';
34 document.body.appendChild(iframe);
35
36 window.jsTestIsAsync = true; 37 window.jsTestIsAsync = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698