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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/invalid-internals-arguments.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("Verify that using invalid or detached documents on internal test me thods does not crash.");
2
3 // The internals object and these test methods aren't available in production
4 // builds, but they are exposed to fuzzers.
5
6 if (!window.testRunner || !window.internals)
7 debug('This test can not run without testRunner or internals');
8
9 shouldThrow("internals.setGeolocationClientMock(null);");
10 shouldThrow("internals.setGeolocationPosition(null, 1, 2, 3);");
11 shouldThrow("internals.setGeolocationPermission(window.notThere, true);");
12 shouldThrow("internals.setGeolocationPositionUnavailableError(null, 'not availab le');");
13 shouldThrow("internals.numberOfPendingGeolocationPermissionRequests(null)");
14
15 var ifr = document.getElementById("ifr");
16 var iframe = ifr.contentWindow;
17 // Must access it first so it exists, we cannot get internals from a detached fr ame window.
18 var iframeInternals = iframe.internals;
19 ifr.remove();
20
21 // Verify that detached documents do not crash.
22 shouldBeUndefined("iframeInternals.setGeolocationClientMock(iframe.document)");
23 shouldBeUndefined("iframeInternals.setGeolocationPosition(iframe.document, 1, 2, 3)");
24 shouldBeUndefined("iframeInternals.setGeolocationPermission(iframe.document, tru e)");
25 shouldBeUndefined("iframeInternals.setGeolocationPositionUnavailableError(iframe .document, 'not available')");
26 shouldBe("iframeInternals.numberOfPendingGeolocationPermissionRequests(iframe.do cument)", "-1");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698