Conditions: Chrome on Chrome OS, zero Wifi networks are available
Expected: Should still make network geolocation requests (for IP-based location)
Actual (in integration test environment): No network geolocation request is made
----
I ran into this while trying to create an integration test verifying that Chrome issues a network geolocation request to the correct URL including correct Google API key (to help with crbug.com/748921 ).
I found that, on Chrome OS, my test failed because no network geolocation request was issued.
Digging into it, this is because Chrome OS treats "zero Wifi networks found" as a signal to keep waiting, rather than returning the empty list to NetworkLocationProvider.
Specifically, in device/geolocation/wifi_data_provider_chromeos.cc:
WifiDataProviderChromeOs::DidWifiScanTaskNoResults does not call RunCallbacks().
Code archaeology: DidWifiScanTaskNoResults actually used to call RunCallbacks(), but it was removed in crrev.com/23889009 as a fix/workaround to resolve crbug.com/236418.
Possible fixes:
* Make wifi_data_provider_chromeos "eventually" (10 seconds?) give up and actually return the zero networks.
* Better: Figure out how to distinguish between "zero networks found because scanning is still happening" vs "zero networks found and scanning is finished".
Severity:
I suspect this would be a super rare one to see in practice simply because it would require Chrome OS to be connected to the internet but not be able to see any Wifi networks. (I haven't tried to reproduce those conditions myself to see this in a prod situation.)
Comment 1 by ligim...@chromium.org
, Sep 21 2017