diff --git a/dom/geolocation/nsGeolocation.cpp b/dom/geolocation/nsGeolocation.cpp index f5ad55552cde..487ca6a4e7f1 100644 --- a/dom/geolocation/nsGeolocation.cpp +++ b/dom/geolocation/nsGeolocation.cpp @@ -516,6 +516,8 @@ nsGeolocationRequest::GetRequester(nsIContentPermissionRequester** aRequester) void nsGeolocationRequest::SetTimeoutTimer() { + MOZ_ASSERT(!mShutdown, "set timeout after shutdown"); + StopTimeoutTimer(); if (mOptions && mOptions->mTimeout != 0 && mOptions->mTimeout != 0x7fffffff) { @@ -585,7 +587,10 @@ nsGeolocationRequest::SendLocation(nsIDOMGeoPosition* aPosition) MOZ_ASSERT(callback); callback->HandleEvent(aPosition); } - SetTimeoutTimer(); + + if (mIsWatchPositionRequest && !mShutdown) { + SetTimeoutTimer(); + } MOZ_ASSERT(mShutdown || mIsWatchPositionRequest, "non-shutdown getCurrentPosition request after callback!"); } diff --git a/dom/tests/mochitest/geolocation/chrome.ini b/dom/tests/mochitest/geolocation/chrome.ini new file mode 100644 index 000000000000..1922074f178d --- /dev/null +++ b/dom/tests/mochitest/geolocation/chrome.ini @@ -0,0 +1,6 @@ +[DEFAULT] +support-files = + geolocation_common.js + network_geolocation.sjs + +[test_handlerSpinsEventLoop.html] diff --git a/dom/tests/mochitest/geolocation/mochitest.ini b/dom/tests/mochitest/geolocation/mochitest.ini index c11e6745206d..1afcc31cb38d 100644 --- a/dom/tests/mochitest/geolocation/mochitest.ini +++ b/dom/tests/mochitest/geolocation/mochitest.ini @@ -15,7 +15,6 @@ support-files = [test_clearWatch_invalid.html] [test_errorcheck.html] [test_geolocation_is_undefined_when_pref_is_off.html] -[test_handlerSpinsEventLoop.html] [test_manyCurrentConcurrent.html] [test_manyCurrentSerial.html] [test_manyWatchConcurrent.html] diff --git a/dom/tests/mochitest/geolocation/test_handlerSpinsEventLoop.html b/dom/tests/mochitest/geolocation/test_handlerSpinsEventLoop.html index ad9814587876..becb463cc5c0 100644 --- a/dom/tests/mochitest/geolocation/test_handlerSpinsEventLoop.html +++ b/dom/tests/mochitest/geolocation/test_handlerSpinsEventLoop.html @@ -5,10 +5,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=911595 -->