WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
88657
[WK2] Missing API to check whether WebKitTestRunner is being used
https://bugs.webkit.org/show_bug.cgi?id=88657
Summary
[WK2] Missing API to check whether WebKitTestRunner is being used
Mario Sanchez Prada
Reported
2012-06-08 07:08:32 PDT
In WK1, some ports use specific functions in WK1 to detect when DumpRenderTree is being used (see DumpRenderTreeSupport{Gtk|Qt}::setDumpRenderTreeModeEnabled), so they can make interesting decisions when initializing the WebView, such as installing mock clients instead of the "good ones" (e.g. GeolocationClientMock). However, that feature seems to be missing in WK2 (or at least I could not find it) and I think it would be very useful too for similar situations, hence this bug. Maybe there's already a way to do this, in that case feel free to point it out and/or close this bug. Thanks (CCing people I think might be interested on this)
Attachments
Patch proposal
(7.89 KB, patch)
2012-06-08 07:30 PDT
,
Mario Sanchez Prada
benjamin
: review-
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Mario Sanchez Prada
Comment 1
2012-06-08 07:30:25 PDT
Created
attachment 146565
[details]
Patch proposal
Mario Sanchez Prada
Comment 2
2012-06-08 08:30:30 PDT
This doesn't depend on 59201. It *blocks* 59201
Mario Sanchez Prada
Comment 3
2012-07-19 02:28:36 PDT
Ping reviewers?
Benjamin Poulain
Comment 4
2012-09-20 19:04:22 PDT
Comment on
attachment 146565
[details]
Patch proposal View in context:
https://bugs.webkit.org/attachment.cgi?id=146565&action=review
> Source/WebKit2/ChangeLog:9 > + New API to allow declaring that WebKitTestRunner is running (on > + initialization) and checking that value from the WebProcess.
But why?
Mario Sanchez Prada
Comment 5
2012-09-21 13:18:52 PDT
(In reply to
comment #4
)
> (From update of
attachment 146565
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=146565&action=review
> > > Source/WebKit2/ChangeLog:9 > > + New API to allow declaring that WebKitTestRunner is running (on > > + initialization) and checking that value from the WebProcess. > > But why?
The reason is to do something similar to what it's done in WK1, where you need to know when WebKit is running for its normal use case or when it's running for serving the DumpRenderTree, since the kind of geolocation provider that must use is different. In the former case, the normal geolocation provider (e.g. Geoclue based) will be used, but for layout tests we need a special kind of geolocation provider (the mock provider) which allows us also to specify the position, so we can later check that the actual and expected results are the same. As you can see in the patch for
bug 59201
, this new API is used in WebPage.cpp precisely to know when we will use the normal geolocation provider or the mock provider, so that's the reason of this API.
Benjamin Poulain
Comment 6
2012-09-21 14:11:44 PDT
> The reason is to do something similar to what it's done in WK1, where you need to know when WebKit is running for its normal use case or when it's running for serving the DumpRenderTree, since the kind of geolocation provider that must use is different. > > In the former case, the normal geolocation provider (e.g. Geoclue based) will be used, but for layout tests we need a special kind of geolocation provider (the mock provider) which allows us also to specify the position, so we can later check that the actual and expected results are the same. > > As you can see in the patch for
bug 59201
, this new API is used in WebPage.cpp precisely to know when we will use the normal geolocation provider or the mock provider, so that's the reason of this API.
This is not how you are supposed to do those tests. Even if we had to change a client, that should be done through the injected bundle.
Mario Sanchez Prada
Comment 7
2012-09-21 14:18:16 PDT
(In reply to
comment #6
)
> [...] > This is not how you are supposed to do those tests. > > Even if we had to change a client, that should be done through the injected bundle.
You are right. This is all conceptually broken, now I see it. Thanks for the explanations. I'm now closing this bug
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug