Index: content/browser/geolocation/geolocation_provider.cc |
diff --git a/content/browser/geolocation/geolocation_provider.cc b/content/browser/geolocation/geolocation_provider.cc |
index 2b626d8db0c1ae01e953ae5c1ad6eefaa6523c89..c9789b44e44219ef869e312a993c9775a3ee77af 100644 |
--- a/content/browser/geolocation/geolocation_provider.cc |
+++ b/content/browser/geolocation/geolocation_provider.cc |
@@ -21,9 +21,13 @@ void GeolocationProvider::AddObserver(GeolocationObserver* observer, |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
observers_[observer] = update_options; |
OnClientsChanged(); |
- if (position_.Validate() || |
- position_.error_code != Geoposition::ERROR_CODE_NONE) |
- observer->OnLocationUpdate(position_); |
+ if (ignore_location_updates_) { |
+ // Position has been overridden for testing. Tests expect the observers to |
+ // be called synchronously in this case. |
+ if (position_.Validate() || |
+ position_.error_code != Geoposition::ERROR_CODE_NONE) |
+ observer->OnLocationUpdate(position_); |
John Knottenbelt
2012/11/18 16:03:07
We don't want to send this if we're the first obse
|
+ } |
} |
bool GeolocationProvider::RemoveObserver(GeolocationObserver* observer) { |