Bug 219081

Summary: [GTK] MiniBrowser: add an option to quit the browser after loading finishes
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, clopez, svillar
Priority: P2 Keywords: Gtk
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=219737
Attachments:
Description Flags
Patch clopez: review+, clopez: commit-queue-

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>