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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame-already.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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame-already.js
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame-already.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame-already.js
index bc25717a499ab8cb15bcf734360f5415cf054257..c91cff752b068bdc343db9b0521af2f93bff7851 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame-already.js
+++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame-already.js
@@ -1,18 +1,23 @@
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.");
-if (!window.testRunner || !window.internals)
- debug('This test can not run without testRunner or internals');
+if (!window.testRunner || !window.mojo)
+ debug('This test can not run without testRunner or mojo');
-internals.setGeolocationClientMock(document);
-internals.setGeolocationPermission(document, true);
-internals.setGeolocationPosition(document, 51.478, -0.166, 100);
+var iframe = document.createElement('iframe');
+
+geolocationServiceMock.then(mock => {
+ mock.setGeolocationPermission(true);
+ mock.setGeolocationPosition(51.478, -0.166, 100);
+
+ iframe.src = 'resources/disconnected-frame-already-inner1.html';
+ document.body.appendChild(iframe);
+});
function onFirstIframeLoaded() {
iframeGeolocation = iframe.contentWindow.navigator.geolocation;
iframe.src = 'resources/disconnected-frame-already-inner2.html';
}
-var error;
function onSecondIframeLoaded() {
iframeGeolocation.getCurrentPosition(function () {
testFailed('Success callback invoked unexpectedly');
@@ -29,8 +34,4 @@ function finishTest() {
finishJSTest();
}
-var iframe = document.createElement('iframe');
-iframe.src = 'resources/disconnected-frame-already-inner1.html';
-document.body.appendChild(iframe);
-
window.jsTestIsAsync = true;

Powered by Google App Engine
This is Rietveld 408576698