Bug 113633

Summary: Allow WebUserMediaClientMock to be used by client
Product: WebKit Reporter: wjia
Component: Tools / TestsAssignee: wjia
Status: RESOLVED INVALID    
Severity: Normal CC: abarth, dglazkov, dpranke, eric, fishd, jamesr, jochen, levin, leviw, peter+ews, tkent+wkapi, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 113678    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Archive of layout-test-results from gce-cr-linux-05 for chromium-linux-x86_64
none
Patch webkit.review.bot: commit-queue-

Description wjia 2013-03-29 19:29:38 PDT
To enable media stream layout test in chromium content_shell, WebUserMediaClientMock is needed.
Comment 1 wjia 2013-03-30 11:12:04 PDT
Created attachment 195861 [details]
Patch
Comment 2 WebKit Review Bot 2013-03-30 11:14:40 PDT
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
Comment 3 wjia 2013-03-30 11:25:52 PDT
This is pre-requisite for https://codereview.chromium.org/13247006/ which tries to enable media stream layout test with conent_shell.
Comment 4 Adam Barth 2013-03-30 11:48:06 PDT
Comment on attachment 195861 [details]
Patch

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

> Tools/DumpRenderTree/chromium/TestRunner/public/WebUserMediaClientMock.h:34
> +#include "TestCommon.h"

Is TestCommon a public header?  Do you mean WebTestCommon?
Comment 5 wjia 2013-03-30 12:39:30 PDT
(In reply to comment #4)
> (From update of attachment 195861 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=195861&action=review
> 
> > Tools/DumpRenderTree/chromium/TestRunner/public/WebUserMediaClientMock.h:34
> > +#include "TestCommon.h"
> 
> Is TestCommon a public header?  Do you mean WebTestCommon?

TestCommon.h is in DumpRenderTree/chromium/TestRunner/src. I just moved WebUserMediaClientMock.h from src/ to public/ in order to add WEBKIT_EXPORT. It seems there could be some file re-shuffling needed if file in public/ can't depend on files in src/. But I am not sure if that's a requirement or not.
Comment 6 Adam Barth 2013-03-30 12:41:04 PDT
Comment on attachment 195861 [details]
Patch

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

> Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:105
> +                    '../chromium/TestRunner/src',

Public cannot depend on SRC.
Comment 7 wjia 2013-03-30 13:48:48 PDT
Created attachment 195870 [details]
Patch
Comment 8 wjia 2013-03-30 13:50:45 PDT
The 2nd patch moves TestCommon.h from src/ into public/ and public/ doesn't depend on src/ now.
Comment 9 Adam Barth 2013-03-30 14:20:51 PDT
Comment on attachment 195870 [details]
Patch

There's no reason to move TestCommon to the public API.
Comment 10 wjia 2013-03-30 16:33:57 PDT
(In reply to comment #9)
> (From update of attachment 195870 [details])
> There's no reason to move TestCommon to the public API.

Since WebUserMediaClientMock.h uses TestCommon.h, is it ok to just expand content of TestCommon.h in WebUserMediaClientMock.h if TestCommon.h is not allowed to move to public? Or do you have other suggestions?
Comment 11 wjia 2013-03-30 17:01:07 PDT
Created attachment 195875 [details]
Patch
Comment 12 Adam Barth 2013-03-30 17:02:18 PDT
The functions don't appear to be used.  If they are used, you'll need to refactor the code.
Comment 13 Adam Barth 2013-03-30 17:03:22 PDT
Comment on attachment 195875 [details]
Patch

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

> Tools/DumpRenderTree/chromium/TestRunner/public/WebUserMediaClientMock.h:36
> +#include <base/compiler_specific.h>

This is a bad dependency.  It should not be needed.
Comment 14 Adam Barth 2013-03-30 17:04:14 PDT
Looks like you need to remove the OVERRIDE qualifier.
Comment 15 wjia 2013-03-30 17:07:21 PDT
(In reply to comment #14)
> Looks like you need to remove the OVERRIDE qualifier.

base/compiler_specific.h is needed because of "OVERRIDE". "OVERRIDE" can help us to detect any function change in base class, and it's encouraged to use it whenever possible. Does WebKit have different tradition than Chromium?
Comment 16 wjia 2013-03-30 17:13:00 PDT
Created attachment 195876 [details]
Patch
Comment 17 Adam Barth 2013-03-30 17:17:24 PDT
> base/compiler_specific.h is needed because of "OVERRIDE". "OVERRIDE" can help us to detect any function change in base class, and it's encouraged to use it whenever possible. Does WebKit have different tradition than Chromium?

We use OVERRIDE in WebKit as well, but we don't use it in the API to avoid these sorts of dependency problems.
Comment 18 Adam Barth 2013-03-30 17:20:15 PDT
Comment on attachment 195876 [details]
Patch

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

> Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:103
> +                    '<(source_dir)/WebKit/chromium/public',

This doesn't look correct.  Lots of things in TestRunner talk about concepts from this directory, but we haven't needed this build rule previously.

Take a look at http://trac.webkit.org/browser/trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h to see the correct pattern for including these sorts of headers.
Comment 19 wjia 2013-03-30 17:45:25 PDT
Created attachment 195880 [details]
Patch
Comment 20 Adam Barth 2013-03-30 17:52:54 PDT
Comment on attachment 195880 [details]
Patch

This looks good.  Thanks for iterating on this patch.
Comment 21 WebKit Review Bot 2013-03-31 16:16:11 PDT
Comment on attachment 195880 [details]
Patch

Clearing flags on attachment: 195880

Committed r147289: <http://trac.webkit.org/changeset/147289>
Comment 22 WebKit Review Bot 2013-03-31 16:16:15 PDT
All reviewed patches have been landed.  Closing bug.
Comment 23 WebKit Review Bot 2013-03-31 23:47:05 PDT
Re-opened since this is blocked by bug 113678
Comment 24 jochen 2013-04-01 00:42:04 PDT
Why are you using WEBKIT_EXPORT instead of WEBTESTRUNNER_EXPORT?

And why are you exposing the mock in the api instead of overriding the methods that will return the mock in WebTestProxy?
Comment 25 wjia 2013-04-01 11:36:52 PDT
(In reply to comment #24)
> Why are you using WEBKIT_EXPORT instead of WEBTESTRUNNER_EXPORT?

Will use WEBTESTRUNNER_EXPORT.

> 
> And why are you exposing the mock in the api instead of overriding the methods that will return the mock in WebTestProxy?

That's anther way to access WebUserMediaClientMock. But userMediaClient() is protected in WebTestProxyBase which is used in WebKitTestRunner. Is it ok to move userMediaClient() into public in WebTestProxyBase? I don't think downcasting from WebTestProxyBase to WebTestProxy would be a good choice.
Comment 26 jochen 2013-04-01 11:39:02 PDT
(In reply to comment #25)
> (In reply to comment #24)
> > Why are you using WEBKIT_EXPORT instead of WEBTESTRUNNER_EXPORT?
> 
> Will use WEBTESTRUNNER_EXPORT.
> 
> > 
> > And why are you exposing the mock in the api instead of overriding the methods that will return the mock in WebTestProxy?
> 
> That's anther way to access WebUserMediaClientMock. But userMediaClient() is protected in WebTestProxyBase which is used in WebKitTestRunner. Is it ok to move userMediaClient() into public in WebTestProxyBase? I don't think downcasting from WebTestProxyBase to WebTestProxy would be a good choice.

WebTestProxy inherits from WebTestProxyBase, so it can access protected members.
Comment 27 wjia 2013-04-01 11:43:58 PDT
(In reply to comment #26)
> (In reply to comment #25)
> > (In reply to comment #24)
> > > Why are you using WEBKIT_EXPORT instead of WEBTESTRUNNER_EXPORT?
> > 
> > Will use WEBTESTRUNNER_EXPORT.
> > 
> > > 
> > > And why are you exposing the mock in the api instead of overriding the methods that will return the mock in WebTestProxy?
> > 
> > That's anther way to access WebUserMediaClientMock. But userMediaClient() is protected in WebTestProxyBase which is used in WebKitTestRunner. Is it ok to move userMediaClient() into public in WebTestProxyBase? I don't think downcasting from WebTestProxyBase to WebTestProxy would be a good choice.
> 
> WebTestProxy inherits from WebTestProxyBase, so it can access protected members.

I knew that. The question is how to access WebTestProxy in ShellContentRendererClient where overriding WebUserMediaClient happens? ShellContentRendererClient can access WebKitTestRunner which has only WebTestProxyBase, not WebTestProxy.
Comment 28 wjia 2013-04-01 17:17:30 PDT
Created attachment 196043 [details]
Patch
Comment 29 wjia 2013-04-01 17:18:23 PDT
The new patch depends on https://codereview.chromium.org/13159005/.
Comment 30 WebKit Review Bot 2013-04-02 03:43:49 PDT
Comment on attachment 196043 [details]
Patch

Attachment 196043 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://webkit-commit-queue.appspot.com/results/17327797

New failing tests:
http/tests/media/reload-after-dialog.html
compositing/self-painting-layers2.html
compositing/video/video-reflection.html
compositing/video/video-with-invalid-source.html
http/tests/media/video-referer.html
http/tests/media/video-cancel-load.html
http/tests/appcache/video.html
http/tests/media/video-play-stall-before-meta-data.html
compositing/overflow/overflow-compositing-descendant.html
compositing/layers-inside-overflow-scroll.html
compositing/self-painting-layers.html
compositing/overflow/scroll-ancestor-update.html
compositing/visibility/visibility-simple-video-layer.html
http/tests/canvas/webgl/origin-clean-conformance.html
compositing/geometry/video-opacity-overlay.html
compositing/reflections/load-video-in-reflection.html
compositing/geometry/video-fixed-scrolling.html
http/tests/media/text-served-as-text.html
http/tests/media/video-served-as-text.html
http/tests/media/video-load-suspend.html
http/tests/media/video-query-url.html
http/tests/media/video-error-abort.html
http/tests/media/remove-while-loading.html
http/tests/media/video-buffered-range-contains-currentTime.html
compositing/video/video-poster.html
http/tests/media/media-document.html
http/tests/media/video-cookie.html
compositing/geometry/clipped-video-controller.html
http/tests/media/video-throttled-load-metadata.html
http/tests/media/video-load-twice.html
Comment 31 WebKit Review Bot 2013-04-02 03:43:55 PDT
Created attachment 196114 [details]
Archive of layout-test-results from gce-cr-linux-05 for chromium-linux-x86_64

The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: gce-cr-linux-05  Port: chromium-linux-x86_64  Platform: Linux-3.3.8-gcg-201212281604-x86_64-with-GCEL-10.04-gcel_10.04
Comment 32 jochen 2013-04-02 03:59:25 PDT
Comment on attachment 196043 [details]
Patch

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

> Tools/DumpRenderTree/chromium/WebViewHost.cpp:734
> +    return createMediaPlayer(frame, url, client);

since createMediaPlayer is now un-used, you should copy it's body here and delete it

> Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp:1000
> +    if (m_delegate)

m_delegate should always be non-0
Comment 33 wjia 2013-04-02 19:00:06 PDT
Created attachment 196266 [details]
Patch
Comment 34 wjia 2013-04-02 19:03:25 PDT
Patch (on 4/2) depends on https://codereview.chromium.org/13159005/. Before that Chromium patch is landed, it's likely this patch will break webkit bots.
Comment 35 WebKit Review Bot 2013-04-02 19:03:52 PDT
Comment on attachment 196266 [details]
Patch

Attachment 196266 [details] did not pass cr-linux-debug-ews (chromium-xvfb):
Output: http://webkit-commit-queue.appspot.com/results/17351493
Comment 36 Peter Beverloo (cr-android ews) 2013-04-02 19:21:47 PDT
Comment on attachment 196266 [details]
Patch

Attachment 196266 [details] did not pass cr-android-ews (chromium-android):
Output: http://webkit-commit-queue.appspot.com/results/17386177
Comment 37 WebKit Review Bot 2013-04-02 19:24:26 PDT
Comment on attachment 196266 [details]
Patch

Attachment 196266 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://webkit-commit-queue.appspot.com/results/17360159
Comment 38 Levi Weintraub 2013-04-08 10:48:59 PDT
This should be moved to blink.