<html>
    <head>
      <base href="https://bugs.webkit.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Add SPI for handling geolocation authorization requests"
   href="https://bugs.webkit.org/show_bug.cgi?id=170362#c8">Comment # 8</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Add SPI for handling geolocation authorization requests"
   href="https://bugs.webkit.org/show_bug.cgi?id=170362">bug 170362</a>
              from <span class="vcard"><a class="email" href="mailto:achristensen&#64;apple.com" title="Alex Christensen &lt;achristensen&#64;apple.com&gt;"> <span class="fn">Alex Christensen</span></a>
</span></b>
        <pre>(In reply to David Quesada from <a href="show_bug.cgi?id=170362#c7">comment #7</a>)
<span class="quote">&gt; (In reply to Alex Christensen from <a href="show_bug.cgi?id=170362#c6">comment #6</a>)
&gt; &gt; Comment on <span class=""><a href="attachment.cgi?id=306015&amp;action=diff" name="attach_306015" title="Patch">attachment 306015</a> <a href="attachment.cgi?id=306015&amp;action=edit" title="Patch">[details]</a></span>
&gt; &gt; Patch
&gt; &gt; 
&gt; &gt; View in context:
&gt; &gt; <a href="https://bugs.webkit.org/attachment.cgi?id=306015&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=306015&amp;action=review</a>
&gt; &gt; 
&gt; &gt; Test failure seems unrelated.  This looks good.  It seems like we had a
&gt; &gt; synchronous callback and this adds an asynchronous one.
&gt; 
&gt; As far as I know, nothing uses the synchronous method (specifically, it is
&gt; not being used for the purpose for which it was added), so I would like to
&gt; get rid of it. But removing SPI probably isn't something I can just bundle
&gt; in with another change.</span >
If we're sure nothing uses it, we can remove the calls to it and mark it as dead somehow.
<span class="quote">&gt; 
&gt; &gt; You should make an API test that opens a page that requests geolocation data
&gt; &gt; and asynchronously call the decisionHandler with a callOnMainThread in the
&gt; &gt; delegate callback that calls the decisionHandler.  Then we can do things
&gt; &gt; like test the behavior if the delegate callback isn't there, test the
&gt; &gt; behavior if we call the callback twice, make sure there are no
&gt; &gt; use-after-free bugs on the asan bots, make sure the expected behavior
&gt; &gt; happens in JavaScript when a request is accepted and denied, etc.
&gt; 
&gt; I can look into doing this. I wasn't sure API tests would work
&gt; out-of-the-box for this, since we would possibly have to either (1) entitle
&gt; TestWebKitAPI for location services access or (2) expose more about
&gt; WKGeolocationProviderIOS and WebGeolocationCoreLocationProvider so the API
&gt; tests can configure WKGeolocationProviderIOS to go through its motions
&gt; without actually touching CoreLocation.
&gt; 
&gt; If we didn't make either of these changes, the API tests would fail or get
&gt; stuck at the system location prompt when TestWebKitAPI tries to request
&gt; location permission. If we only did (1), there may be flakiness when running
&gt; the tests if geolocation isn’t available on the machine running the
&gt; simulator and tests. (2) is more architectural work than I would have liked
&gt; to do for this, but I’ll make these changes if this is the best approach.
&gt; What are your thoughts?</span >
DumpRenderTree has a MockGeolocationProvider.  We should use something similar, or even move that to WebCoreTestSupport.
<span class="quote">&gt; 
&gt; &gt; 
&gt; &gt; &gt; Source/WebKit2/UIProcess/ios/WKGeolocationProviderIOS.mm:185
&gt; &gt; &gt; +            URL requestFrameURL(URL(), request.frame-&gt;url());
&gt; &gt; 
&gt; &gt; Can't we just call the copy constructor here?
&gt; 
&gt; Sorry, I lazily copied this from the synchronous delegate call. That would
&gt; make it just &quot;URL requestFrameURL(request.frame-&gt;url());&quot; , right?</span >
auto requestFrameURL = request.frame-&gt;url();
I guess that's the operator=, not the copy constructor.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>