Bug 219081 - [GTK] MiniBrowser: add an option to quit the browser after loading finishes
Summary: [GTK] MiniBrowser: add an option to quit the browser after loading finishes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2020-11-18 06:16 PST by Carlos Garcia Campos
Modified: 2020-12-10 05:19 PST (History)
3 users (show)

See Also:


Attachments
Patch (6.21 KB, patch)
2020-11-18 06:21 PST, Carlos Garcia Campos
clopez: review+
clopez: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2020-11-18 06:16:30 PST
It's useful to run benchmarks or test case reduction tools
Comment 1 Carlos Garcia Campos 2020-11-18 06:21:13 PST
Created attachment 414444 [details]
Patch
Comment 2 Carlos Alberto Lopez Perez 2020-11-19 05:35:04 PST
Comment on attachment 414444 [details]
Patch

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

> Tools/MiniBrowser/gtk/main.c:594
> +static void exitAfterWebProcessCrashed(WebKitWebView *webView, WebKitWebProcessTerminationReason reason, GApplication *application)
> +{
> +    if (reason == WEBKIT_WEB_PROCESS_CRASHED)
> +        exitAfterWebViewLoadFinishesCallback(webView, WEBKIT_LOAD_FINISHED, application);

In this case I think it will be useful to print an error message saying that the webprocess has crashed.
Otherwise it can be confusing, and the user can't easily tell if the minibrowser is exiting because the load has finished correctly or because of a crash from the webprocess.
Also setting a non-zero exit code in this case can be also useful for tests.
Comment 3 Carlos Garcia Campos 2020-11-19 06:00:14 PST
Comment on attachment 414444 [details]
Patch

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

>> Tools/MiniBrowser/gtk/main.c:594
>> +        exitAfterWebViewLoadFinishesCallback(webView, WEBKIT_LOAD_FINISHED, application);
> 
> In this case I think it will be useful to print an error message saying that the webprocess has crashed.
> Otherwise it can be confusing, and the user can't easily tell if the minibrowser is exiting because the load has finished correctly or because of a crash from the webprocess.
> Also setting a non-zero exit code in this case can be also useful for tests.

The message is always printed by the webProcessTerminatedCallback() in BrowserTab.c. I think it's a good idea to exit(1) instead of g_application_quit().
Comment 4 Carlos Garcia Campos 2020-11-27 02:02:33 PST
Committed r270186: <https://trac.webkit.org/changeset/270186>