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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/clear-watch-invalid-id-crash.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
1 description("Tests for a crash when clearWatch() is called with a zero ID.<br><b r>We call clearWatch() with a request in progress then navigate the page. This a ccesses the watchers map during cleanup and triggers the crash. This page should not be visible when the test completes."); 1 description("Tests for a crash when clearWatch() is called with a zero ID.<br><b r>We call clearWatch() with a request in progress then navigate the page. This a ccesses the watchers map during cleanup and triggers the crash. This page should not be visible when the test completes.");
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
6 internals.setGeolocationClientMock(document);
7 internals.setGeolocationPermission(document, true);
8 internals.setGeolocationPosition(document, 51.478, -0.166, 100);
9 5
10 document.body.onload = function() { 6 document.body.onload = function() {
11 navigator.geolocation.watchPosition(function() {}); 7 geolocationServiceMock.then(mock => {
12 navigator.geolocation.clearWatch(0); 8 mock.setGeolocationPermission(true);
13 location = "data:text/html,TEST COMPLETE<script>if(window.testRunner) testRu nner.notifyDone();</script>"; 9 mock.setGeolocationPosition(51.478, -0.166, 100);
10
11 navigator.geolocation.watchPosition(function() {});
12 navigator.geolocation.clearWatch(0);
13 location = "data:text/html,TEST COMPLETE<script>if(window.testRunner) te stRunner.notifyDone();</script>";
14 });
14 } 15 }
15 16
16 window.jsTestIsAsync = true; 17 window.jsTestIsAsync = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698