Bug 144079 - Provide a runtime flag to run-webkit-tests that shows the test view
Summary: Provide a runtime flag to run-webkit-tests that shows the test view
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords:
Depends on:
Blocks: 144588 144589 144621
  Show dependency treegraph
 
Reported: 2015-04-22 16:26 PDT by Brent Fulgham
Modified: 2015-05-04 21:13 PDT (History)
1 user (show)

See Also:


Attachments
Patch (15.45 KB, patch)
2015-04-30 12:23 PDT, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch (11.09 KB, patch)
2015-04-30 15:26 PDT, Brent Fulgham
dino: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2015-04-22 16:26:44 PDT
I find it helpful when debugging tests to be able to see the WebView as the test runs. We should provide a runtime flag so that instead of rendering off screen we can display the view.

This should be available for:
1. DumpRenderTree
2. WebKitTestRunner
3. TestWebKitAPI
Comment 1 Brent Fulgham 2015-04-30 12:13:28 PDT
Skipping TestWebKitAPI for now, since it doesn't process its own arguments (it's all driven by the Google test infrastructure.
Comment 2 Brent Fulgham 2015-04-30 12:23:27 PDT
Since this is only needed for debugging while creating tests, we will invoke it via the "--additional-drt-flag" option:

--additional-drt-flag="--show-webview"
Comment 3 Brent Fulgham 2015-04-30 12:23:39 PDT
Created attachment 252078 [details]
Patch
Comment 4 Simon Fraser (smfr) 2015-04-30 14:17:04 PDT
Comment on attachment 252078 [details]
Patch

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

> Tools/WebKitTestRunner/Options.cpp:115
> +    if (option[0] && option[1] && option[0] == '-' && option[1] == '-')
> +        return true;

Why this bit? It's different from how handleOptionRemoteLayerTree works.

> Tools/WebKitTestRunner/TestInvocation.cpp:180
> +    WKRetainPtr<WKStringRef> shouldShowWebViewKey(AdoptWK, WKStringCreateWithUTF8CString("ShouldShowWebView"));
> +    WKRetainPtr<WKBooleanRef> shouldShowWebViewValue = adoptWK(WKBooleanCreate(TestController::singleton().shouldShowWebView()));
> +    WKDictionarySetItem(beginTestMessageBody.get(), shouldShowWebViewKey.get(), shouldShowWebViewValue.get());

I don't get why these have to go to the injected bundle. We create the view in the UI process.
Comment 5 Brent Fulgham 2015-04-30 15:26:45 PDT
Created attachment 252095 [details]
Patch
Comment 6 Brent Fulgham 2015-04-30 15:28:03 PDT
(In reply to comment #4)
> Comment on attachment 252078 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=252078&action=review
> 
> > Tools/WebKitTestRunner/Options.cpp:115
> > +    if (option[0] && option[1] && option[0] == '-' && option[1] == '-')
> > +        return true;
> 
> Why this bit? It's different from how handleOptionRemoteLayerTree works.

OK -- I fixed it to be consistent with "--remote-layer-tree".

> > Tools/WebKitTestRunner/TestInvocation.cpp:180
> > +    WKRetainPtr<WKStringRef> shouldShowWebViewKey(AdoptWK, WKStringCreateWithUTF8CString("ShouldShowWebView"));
> > +    WKRetainPtr<WKBooleanRef> shouldShowWebViewValue = adoptWK(WKBooleanCreate(TestController::singleton().shouldShowWebView()));
> > +    WKDictionarySetItem(beginTestMessageBody.get(), shouldShowWebViewKey.get(), shouldShowWebViewValue.get());
> 
> I don't get why these have to go to the injected bundle. We create the view
> in the UI process.

I was just blindly following the "timeout" option. We don't need this for the InjectedBundle. I'll remove it.
Comment 7 Brent Fulgham 2015-04-30 16:15:05 PDT
Committed r183651: <http://trac.webkit.org/changeset/183651>
Comment 8 Brent Fulgham 2015-05-01 09:24:46 PDT
Follow-up correction landed in r183765:
Committed r183765: <http://trac.webkit.org/changeset/183765>