<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>233391</bug_id>
          
          <creation_ts>2021-11-19 17:52:35 -0800</creation_ts>
          <short_desc>[WebDriver][GLIB] Timeout navigating to COOP same-origin pages</short_desc>
          <delta_ts>2021-11-19 18:02:46 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebDriver</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>166679</blocked>
    
    <blocked>216899</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Lauro Moura">lmoura</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bburg</cc>
    
    <cc>bugs-noreply</cc>
    
    <cc>cgarcia</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1817055</commentid>
    <comment_count>0</comment_count>
    <who name="Lauro Moura">lmoura</who>
    <bug_when>2021-11-19 17:52:35 -0800</bug_when>
    <thetext>imported/w3c/webdriver/tests/get_window_handle/get.py::test_navigation_with_coop_headers[capabilities0]

Timing out waiting for the response setting the URL in the following snippet:

```
@pytest.mark.capabilities({&quot;acceptInsecureCerts&quot;: True})
def test_navigation_with_coop_headers(session, url):
    base_path = (&quot;/webdriver/tests/support/html/subframe.html&quot; +
                 &quot;?pipe=header(Cross-Origin-Opener-Policy,same-origin&quot;)

    session.url = url(base_path, protocol=&quot;https&quot;)
```

If we remove the pipe defining the COOP header, the assignment returns normally. This also happens when trying to fetch a page with COOP same-origin from a custom server through selenium&apos;s RemoteWebDriver.

FTR, the coop LayoutTests are working fine.

Checking the journal with WEBKIT_DEBUG=All, the NetworkProcess request for the non-coop page returns right away.

Meanwhile, the response for a COOP page also loads the page to the finish, but the webdriver request never returns, both in the WPT test and the Selenium script. Between the request and the response, the journal logs a large number of loader-related messages (see below)

Maybe something in the automation-related code is losing track of the load after receiving the COOP?

Tests scripts to be attached in the following comments


[NetworkProcess GET request before]
 WebKitWebProcess[2586504]: 0x7f4199e7e000 - [pageID=17, frameID=3, main=1] FrameLoader::setPolicyDocumentLoader: Setting policy document loader to 0x7f41306f6c00 (was (nil))
 WebKitWebProcess[2586504]: 0x7f41306f6c00 - [pageID=17, frameID=3, main=1] DocumentLoader::DocumentLoader::attachToFrame: m_frame=0x7f4199e7f000
 WebKitWebProcess[2586504]: 0x7f4199e7e000 - [pageID=17, frameID=3, main=1] FrameLoader::setProvisionalDocumentLoader: Setting provisional document loader to 0x7f41306f6c00 (was (nil))
 WebKitWebProcess[2586504]: 0x7f4199e7e000 - [pageID=17, frameID=3, main=1] FrameLoader::setDocumentLoader: Setting document loader to 0x7f41306f6c00 (was (nil))
 WebKitWebProcess[2586504]: 0x7f4199e7e000 - [pageID=17, frameID=3, main=1] FrameLoader::transitionToCommitted: Clearing provisional document loader (m_provisionalDocumentLoader=0x7f41306f6c00)
 WebKitWebProcess[2586504]: 0x7f4199e7e000 - [pageID=17, frameID=3, main=1] FrameLoader::setProvisionalDocumentLoader: Setting provisional document loader to (nil) (was 0x7f41306f6c00)
 WebKitWebProcess[2586504]: 0x7f41306f6c00 - [pageID=17, frameID=3, main=1] DocumentLoader::startLoadingMainResource: Returning empty document
 WebKitWebProcess[2586504]: 0x7f4199e7e000 - [pageID=17, frameID=3, main=1] FrameLoader::setState: main frame load completed
 WebKitWebProcess[2586504]: Memory usage info dump at MainFrameLoadCompleted:
 WebKitWebProcess[2586504]:   javascript_gc_heap_capacity_mb: 0
 WebKitWebProcess[2586504]:   page_count: 1
 WebKitWebProcess[2586504]:   backforward_cache_page_count: 0
 WebKitWebProcess[2586504]:   javascript_gc_heap_extra_memory_size_mb: 0
 WebKitWebProcess[2586504]:   document_count: 1
 WebKitWebProcess[2586504]: 0x7f4199e7e000 - [pageID=17, frameID=3, main=1] FrameLoader::load (FrameLoadRequest): frame load started
 WebKitWebProcess[2586504]: 0x7f4199e7e000 - [pageID=17, frameID=3, main=1] FrameLoader::load (DocumentLoader): frame load started
 WebKitWebProcess[2586504]: 0x7f4199e7e000 - [pageID=17, frameID=3, main=1] FrameLoader::loadWithDocumentLoader: frame load started
 WebKitWebProcess[2586504]: 0x7f4199e7e000 - [pageID=17, frameID=3, main=1] FrameLoader::loadWithDocumentLoader: main frame load started
 WebKitWebProcess[2586504]: Memory usage info dump at MainFrameLoadStarted:
 WebKitWebProcess[2586504]:   javascript_gc_heap_capacity_mb: 0
 WebKitWebProcess[2586504]:   page_count: 1
 WebKitWebProcess[2586504]:   backforward_cache_page_count: 0
 WebKitWebProcess[2586504]:   javascript_gc_heap_extra_memory_size_mb: 0
 WebKitWebProcess[2586504]:   document_count: 1
 WebKitWebProcess[2586504]: 0x7f4199e7e000 - [pageID=17, frameID=3, main=1] FrameLoader::setPolicyDocumentLoader: Setting policy document loader to 0x7f41306f8400 (was 0x7f41306f6c00)
 WebKitWebProcess[2586504]: 0x7f41306f8400 - [pageID=17, frameID=3, main=1] DocumentLoader::DocumentLoader::attachToFrame: m_frame=0x7f4199e7f000
 WebKitWebProcess[2586504]: 0x7f4199e7e000 - [pageID=17, frameID=3, main=1] FrameLoader::stopAllLoaders: m_provisionalDocumentLoader=(nil), m_documentLoader=0x7f41306f6c00
 WebKitWebProcess[2586504]: 0x7f41306f6c00 - [pageID=17, frameID=3, main=1] DocumentLoader::DocumentLoader::stopLoading: m_frame=0x7f4199e7f000
 WebKitWebProcess[2586504]: 0x7f4199e7e000 - [pageID=17, frameID=3, main=1] FrameLoader::stopAllLoaders: Clearing provisional document loader (m_provisionalDocumentLoader=(nil))
 WebKitWebProcess[2586504]: 0x7f4199e7e000 - [pageID=17, frameID=3, main=1] FrameLoader::setProvisionalDocumentLoader: Setting provisional document loader to 0x7f41306f8400 (was (nil))
 WebKitWebProcess[2586504]: 0x7f4199e7e000 - [pageID=17, frameID=3, main=1] FrameLoader::continueLoadAfterNavigationPolicy: Setting provisional document loader (m_provisionalDocumentLoader=0x7f41306f8400)
 WebKitWebProcess[2586504]: 0x7f4199e7e000 - [pageID=17, frameID=3, main=1] FrameLoader::setPolicyDocumentLoader: Setting policy document loader to (nil) (was 0x7f41306f8400)
 WebKitWebProcess[2586504]: 0x7f4199e7e000 - [pageID=17, frameID=3, main=1] FrameLoader::prepareForLoadStart: Starting frame load
 WebKitWebProcess[2586504]: 0x7f4199efcea0 - ProgressTracker::progressStarted: frame 0x7f4199e7f000, value 0.100000, tracked frames 1, originating frame 0x7f4199e7f000, isMainLoad 1
 WebKitWebProcess[2586504]: 0x7f41306f8400 - [pageID=17, frameID=3, main=1] DocumentLoader::startLoadingMainResource: Starting load
 WebKitWebProcess[2586504]: 0x7f41984f2480 - [pageID=17, frameID=3, frameLoader=0x7f4199e7e000, resourceID=7] ResourceLoader::willSendRequestInternal: calling completion handler
 WebKitWebProcess[2586504]: 0x7f41984f2480 - [pageID=17, frameID=3, frameLoader=0x7f4199e7e000, resourceID=7] SubresourceLoader::willSendRequestInternal: resource load finished; calling completion handler
 WebKitWebProcess[2586504]: 0x7f4199e7e000 - [pageID=17, frameID=3, main=1] FrameLoader::setDocumentLoader: Setting document loader to 0x7f41306f8400 (was 0x7f41306f6c00)
 WebKitWebProcess[2586504]: 0x7f41306f6c00 - [pageID=17, frameID=3, main=1] DocumentLoader::DocumentLoader::detachFromFrame: m_frame=0x7f4199e7f000
 WebKitWebProcess[2586504]: 0x7f41306f6c00 - [pageID=17, frameID=3, main=1] DocumentLoader::DocumentLoader::stopLoading: m_frame=0x7f4199e7f000
[NetworkProcess GET response after]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1817056</commentid>
    <comment_count>1</comment_count>
      <attachid>444876</attachid>
    <who name="Lauro Moura">lmoura</who>
    <bug_when>2021-11-19 17:54:51 -0800</bug_when>
    <thetext>Created attachment 444876
Selenium standalone script

Script used to load the page with selenium.

Usually invoked with `./coop.py --remote 127.0.0.1:8088 http://localhost:8080/noncoop.html` with the WebDriver running on localhost:8088.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1817057</commentid>
    <comment_count>2</comment_count>
      <attachid>444877</attachid>
    <who name="Lauro Moura">lmoura</who>
    <bug_when>2021-11-19 17:56:34 -0800</bug_when>
    <thetext>Created attachment 444877
Standalone server to fetch coop and non-coop pages

&lt;server&gt;:&lt;port&gt;/coop.html will return a response with COOP enabled. Any other page will return a non-Coop page.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1817058</commentid>
    <comment_count>3</comment_count>
    <who name="Lauro Moura">lmoura</who>
    <bug_when>2021-11-19 18:00:07 -0800</bug_when>
    <thetext>And to run the WebDriver manually inside the SDK:

```
$ ./Tools/Scripts/webkit-flatpak --gtk --release -c bash
[org.webkit.Sdk WebKit]$ export PATH=/app/webkit/WebKitBuild/Release/bin:$PATH
[org.webkit.Sdk WebKit]$ export WEBKIT_EXEC_PATH=/app/webkit/WebKitBuild/Release/bin
[org.webkit.Sdk WebKit]$ export WEBKIT_INJECTED_BUNDLE_PATH=/app/webkit/WebKitBuild/Release/lib
[org.webkit.Sdk WebKit]$ env WEBKIT_DEBUG=All WebKitWebDriver --port=8088 --host=all 
```

The coop.py script automatically defaults to use GTK&apos;s MiniBrowser.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>444876</attachid>
            <date>2021-11-19 17:54:51 -0800</date>
            <delta_ts>2021-11-19 17:54:51 -0800</delta_ts>
            <desc>Selenium standalone script</desc>
            <filename>coop.py</filename>
            <type>text/x-python</type>
            <size>1893</size>
            <attacher name="Lauro Moura">lmoura</attacher>
            
              <data encoding="base64">IyEvdXNyL2Jpbi9lbnYgcHl0aG9uMwoKIiIiU2ltcGxlIHNjcmlwdCBsb2FkaW5nIGEgcGFnZSB3
aXRoIFJlbW90ZVdlYkRyaXZlciIiIgoKaW1wb3J0IGFyZ3BhcnNlCmltcG9ydCB0aW1lCgpmcm9t
IHNlbGVuaXVtIGltcG9ydCB3ZWJkcml2ZXIKCgpkZWYgcGFyc2VfYXJncygpOgogICAgIiIiUGFy
c2UgY29tbWFuZCBsaW5lIGFyZ3VtZW50cyIiIgoKICAgIHBhcnNlciA9IGFyZ3BhcnNlLkFyZ3Vt
ZW50UGFyc2VyKCkKCiAgICBncm91cCA9IHBhcnNlci5hZGRfbXV0dWFsbHlfZXhjbHVzaXZlX2dy
b3VwKCkKICAgIGdyb3VwLmFkZF9hcmd1bWVudCgKICAgICAgICAiLWciLCAiLS1ndGsiLCBhY3Rp
b249InN0b3JlX2NvbnN0IiwgZGVzdD0iZmxhdm9yIiwgY29uc3Q9Imd0ayIsIGRlZmF1bHQ9Imd0
ayIKICAgICkKICAgIGdyb3VwLmFkZF9hcmd1bWVudCgiLXciLCAiLS13cGUiLCBhY3Rpb249InN0
b3JlX2NvbnN0IiwgZGVzdD0iZmxhdm9yIiwgY29uc3Q9IndwZSIpCgogICAgcGFyc2VyLmFkZF9h
cmd1bWVudCgKICAgICAgICAiLS1yZW1vdGUiLCBoZWxwPSJBZGRyZXNzIG9mIHRoZSByZW1vdGUg
V2ViRHJpdmVyLCBsaWtlIDE5Mi4xNjguNjguMTA3OjgwODgiCiAgICApCiAgICBwYXJzZXIuYWRk
X2FyZ3VtZW50KAogICAgICAgICItLWJyb3dzZXIiLAogICAgICAgIGRlZmF1bHQ9Ii9hcHAvd2Vi
a2l0L1dlYktpdEJ1aWxkL1JlbGVhc2UvYmluL01p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CiAgICBwcmludCgiU3RhcnRpbmcgZHJpdmVyLi4uIikKICAgIGRyaXZlciA9IHdlYmRyaXZlci5S
ZW1vdGUoCiAgICAgICAgY29tbWFuZF9leGVjdXRvcj1hcmdzLnJlbW90ZSwKICAgICAgICBkZXNp
cmVkX2NhcGFiaWxpdGllcz1jYXBhYmlsaXRpZXMoYXJncy5mbGF2b3IsIGFyZ3MuYnJvd3Nlciks
CiAgICApCiAgICBwcmludCgiRHJpdmVyIHN0YXJ0ZWQiKQoKICAgIHByaW50KCJMb2FkaW5nIikK
ICAgIGRyaXZlci5nZXQoYXJncy5hZGRyZXNzKQogICAgcHJpbnQoIkxvYWRlZCIpCiAgICB0aW1l
LnNsZWVwKDIpCiAgICBkcml2ZXIuY2xvc2UoKQoKCmlmIF9fbmFtZV9fID09ICJfX21haW5fXyI6
CiAgICBtYWluKCkK
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>444877</attachid>
            <date>2021-11-19 17:56:34 -0800</date>
            <delta_ts>2021-11-19 17:56:34 -0800</delta_ts>
            <desc>Standalone server to fetch coop and non-coop pages</desc>
            <filename>coop_server.py</filename>
            <type>text/x-python</type>
            <size>1473</size>
            <attacher name="Lauro Moura">lmoura</attacher>
            
              <data encoding="base64">IyEvdXNyL2Jpbi9lbnYgcHl0aG9uMwoKIiIiU2ltcGxlIHNlcnZlciB0byB0ZXN0IGxvYWRpbmcg
cGFnZXMgd2l0aC93aXRob3V0IENPT1Agc2FtZS1vcmlnaW4iIiIKCmltcG9ydCBhcmdwYXJzZQpm
cm9tIGh0dHAuc2VydmVyIGltcG9ydCBIVFRQU2VydmVyLCBCYXNlSFRUUFJlcXVlc3RIYW5kbGVy
CmltcG9ydCBzc2wKCgpjbGFzcyBSZWRpcmVjdChCYXNlSFRUUFJlcXVlc3RIYW5kbGVyKToKCiAg
ICBkZWYgZG9fR0VUKHNlbGYpOgogICAgICAgIGlmIHNlbGYucGF0aCA9PSAiL2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AgaWYgcG9ydCA9PSAtMToKICAgICAgICBwb3J0ID0gOTQxMyBpZiBhcmdzLmh0
dHBzIGVsc2UgODA4MAoKICAgIHNlcnZlciA9IEhUVFBTZXJ2ZXIoKCIiLCBwb3J0KSwgUmVkaXJl
Y3QpCiAgICBpZiBhcmdzLmh0dHBzOgogICAgICAgIHNlcnZlci5zb2NrZXQgPSBzc2wud3JhcF9z
b2NrZXQoCiAgICAgICAgICAgIHNlcnZlci5zb2NrZXQsIHNlcnZlcl9zaWRlPVRydWUsIGNlcnRm
aWxlPSIuL2NlcnQucGVtIiwga2V5ZmlsZT0iLi9rZXkucGVtIgogICAgICAgICkKICAgIHByaW50
KCJMaXN0ZW5pbmcgYXQgcG9ydCB7fSIuZm9ybWF0KHBvcnQpKQogICAgc2VydmVyLnNlcnZlX2Zv
cmV2ZXIoKQoKCmlmIF9fbmFtZV9fID09ICJfX21haW5fXyI6CiAgICBtYWluKCkK
</data>

          </attachment>
      

    </bug>

</bugzilla>