Bug 187236 - [GTK] /webkit/WebKitWebView/mouse-target subtest fails
Summary: [GTK] /webkit/WebKitWebView/mouse-target subtest fails
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk, MakingBotsRed, PlatformOnly
Depends on:
Blocks:
 
Reported: 2018-07-01 12:28 PDT by Rob Buis
Modified: 2018-07-03 13:46 PDT (History)
7 users (show)

See Also:


Attachments
Patch (2.83 KB, patch)
2018-07-01 12:40 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (3.06 KB, patch)
2018-07-02 11:21 PDT, Rob Buis
mcatanzaro: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Buis 2018-07-01 12:28:49 PDT
/webkit/WebKitWebView/mouse-target from TestUIClient run FAILs.
Comment 1 Rob Buis 2018-07-01 12:40:30 PDT
Created attachment 344057 [details]
Patch
Comment 2 Daniel Bates 2018-07-01 15:25:38 PDT
Comment on attachment 344057 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=344057&action=review

> Tools/ChangeLog:9
> +        video URL is not exposed this will fail. So allow local file access for the video

Can you please elaborate on what you mean by "the local video URL is not exposed"?

> Tools/TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp:682
> +    WebKitSettings* settings = webkit_web_view_get_settings(test->m_webView);
> +    webkit_settings_set_allow_universal_access_from_file_urls(settings, TRUE);

Can you please explain why we need to universal access? I mean, this test only loads subresources with file URLs. (The markup is substituted for the request with URL file://// and movie.org is computed relative to it, file:///movie.ogg).
Comment 3 Daniel Bates 2018-07-01 15:38:42 PDT
(In reply to Rob Buis from comment #0)
> /webkit/WebKitWebView/mouse-target from TestUIClient run FAILs.

For completeness, here is the error from the GTK Linux 64-bit Debug Tests bot that you are referring to:

[[
  /webkit/WebKitWebView/mouse-target:                                 FAIL
ERROR:/home/slave/webkitgtk/gtk-linux-64-debug/build/Tools/TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp:734:void testWebViewMouseTarget(UIClientTest*, gconstpointer): assertion failed: (webkit_hit_test_result_context_is_media(hitTestResult))
]]
<https://build.webkit.org/builders/GTK%20Linux%2064-bit%20Debug%20%28Tests%29/builds/3307/steps/API%20tests/logs/stdio>
Comment 4 Michael Catanzaro 2018-07-01 15:44:56 PDT
Comment on attachment 344057 [details]
Patch

Thanks for caring for the API tests, Rob! These are important and their current condition is embarrassing.
Comment 5 Rob Buis 2018-07-02 11:21:55 PDT
Created attachment 344118 [details]
Patch
Comment 6 Rob Buis 2018-07-02 11:23:29 PDT
(In reply to Daniel Bates from comment #2)
> Comment on attachment 344057 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=344057&action=review
> 
> > Tools/ChangeLog:9
> > +        video URL is not exposed this will fail. So allow local file access for the video
> 
> Can you please elaborate on what you mean by "the local video URL is not
> exposed"?
> 
> > Tools/TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp:682
> > +    WebKitSettings* settings = webkit_web_view_get_settings(test->m_webView);
> > +    webkit_settings_set_allow_universal_access_from_file_urls(settings, TRUE);
> 
> Can you please explain why we need to universal access? I mean, this test
> only loads subresources with file URLs. (The markup is substituted for the
> request with URL file://// and movie.org is computed relative to it,
> file:///movie.ogg).

Sorry my previous ChangeLog entry was a bit terse, I tried to phrase it better this time. Let me know if it needs even more rephrasing or you think this is the wrong approach.
Comment 7 Daniel Bates 2018-07-02 12:58:25 PDT
(In reply to Rob Buis from comment #6)
> (In reply to Daniel Bates from comment #2)
> > Comment on attachment 344057 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=344057&action=review
> > 
> > > Tools/ChangeLog:9
> > > +        video URL is not exposed this will fail. So allow local file access for the video
> > 
> > Can you please elaborate on what you mean by "the local video URL is not
> > exposed"?
> > 
> > > Tools/TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp:682
> > > +    WebKitSettings* settings = webkit_web_view_get_settings(test->m_webView);
> > > +    webkit_settings_set_allow_universal_access_from_file_urls(settings, TRUE);
> > 
> > Can you please explain why we need to universal access? I mean, this test
> > only loads subresources with file URLs. (The markup is substituted for the
> > request with URL file://// and movie.org is computed relative to it,
> > file:///movie.ogg).
> 
> Sorry my previous ChangeLog entry was a bit terse, I tried to phrase it
> better this time. Let me know if it needs even more rephrasing or you think
> this is the wrong approach.

The revised ChangeLog does not explain why a local file cannot load a local file as a subresource. Can you please explain this?
Comment 8 Rob Buis 2018-07-02 13:20:15 PDT
(In reply to Daniel Bates from comment #7)
> (In reply to Rob Buis from comment #6)
> > (In reply to Daniel Bates from comment #2)
> > > Comment on attachment 344057 [details]
> > > Patch
> > > 
> > > View in context:
> > > https://bugs.webkit.org/attachment.cgi?id=344057&action=review
> > > 
> > > > Tools/ChangeLog:9
> > > > +        video URL is not exposed this will fail. So allow local file access for the video
> > > 
> > > Can you please elaborate on what you mean by "the local video URL is not
> > > exposed"?
> > > 
> > > > Tools/TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp:682
> > > > +    WebKitSettings* settings = webkit_web_view_get_settings(test->m_webView);
> > > > +    webkit_settings_set_allow_universal_access_from_file_urls(settings, TRUE);
> > > 
> > > Can you please explain why we need to universal access? I mean, this test
> > > only loads subresources with file URLs. (The markup is substituted for the
> > > request with URL file://// and movie.org is computed relative to it,
> > > file:///movie.ogg).
> > 
> > Sorry my previous ChangeLog entry was a bit terse, I tried to phrase it
> > better this time. Let me know if it needs even more rephrasing or you think
> > this is the wrong approach.
> 
> The revised ChangeLog does not explain why a local file cannot load a local
> file as a subresource. Can you please explain this?

"local file cannot load a local file as a subresource"? What file do you mean?
Comment 9 Daniel Bates 2018-07-02 14:34:11 PDT
(In reply to Rob Buis from comment #8)
> (In reply to Daniel Bates from comment #7)
> > (In reply to Rob Buis from comment #6)
> > > (In reply to Daniel Bates from comment #2)
> > > > Comment on attachment 344057 [details]
> > > > Patch
> > > > 
> > > > View in context:
> > > > https://bugs.webkit.org/attachment.cgi?id=344057&action=review
> > > > 
> > > > > Tools/ChangeLog:9
> > > > > +        video URL is not exposed this will fail. So allow local file access for the video
> > > > 
> > > > Can you please elaborate on what you mean by "the local video URL is not
> > > > exposed"?
> > > > 
> > > > > Tools/TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp:682
> > > > > +    WebKitSettings* settings = webkit_web_view_get_settings(test->m_webView);
> > > > > +    webkit_settings_set_allow_universal_access_from_file_urls(settings, TRUE);
> > > > 
> > > > Can you please explain why we need to universal access? I mean, this test
> > > > only loads subresources with file URLs. (The markup is substituted for the
> > > > request with URL file://// and movie.org is computed relative to it,
> > > > file:///movie.ogg).
> > > 
> > > Sorry my previous ChangeLog entry was a bit terse, I tried to phrase it
> > > better this time. Let me know if it needs even more rephrasing or you think
> > > this is the wrong approach.
> > 
> > The revised ChangeLog does not explain why a local file cannot load a local
> > file as a subresource. Can you please explain this?
> 
> "local file cannot load a local file as a subresource"? What file do you
> mean?
 
The unit test code is loading the markup as substitute data for a file URL (i.e. we mimic a local file). This markup contains a <video> That loads file:///movie.ogg (a local file).
Comment 10 Michael Catanzaro 2018-07-02 16:36:09 PDT
By default, file URIs do not have permission to load other file URIs. That's controlled by the property WebKitSettings::allow-file-access-from-file-urls.

It might be sufficient to use webkit_settings_set_allow_file_access_from_file_urls() instead of the more heavyweight webkit_settings_set_allow_universal_access_from_file_urls() (which additionally allows access to e.g. localstorage). If so, that would be preferable.
Comment 11 Rob Buis 2018-07-03 13:46:00 PDT
(In reply to Michael Catanzaro from comment #10)
> By default, file URIs do not have permission to load other file URIs. That's
> controlled by the property WebKitSettings::allow-file-access-from-file-urls.
> 
> It might be sufficient to use
> webkit_settings_set_allow_file_access_from_file_urls() instead of the more
> heavyweight webkit_settings_set_allow_universal_access_from_file_urls()
> (which additionally allows access to e.g. localstorage). If so, that would
> be preferable.

I tried webkit_settings_set_allow_file_access_from_file_urls, unfortunately that is not enough to make the test PASS.