OLD | NEW |
(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 ifr.remove(); |
| 18 // Verify that detached documents do not crash. |
| 19 shouldBeUndefined("iframe.internals.setGeolocationClientMock(iframe.document)"); |
| 20 shouldBeUndefined("iframe.internals.setGeolocationPosition(iframe.document, 1, 2
, 3)"); |
| 21 shouldBeUndefined("iframe.internals.setGeolocationPermission(iframe.document, tr
ue)"); |
| 22 shouldBeUndefined("iframe.internals.setGeolocationPositionUnavailableError(ifram
e.document, 'not available')"); |
| 23 shouldBe("iframe.internals.numberOfPendingGeolocationPermissionRequests(iframe.d
ocument)", "-1"); |
OLD | NEW |