Bug 61068

Summary: MediaStream API: add getUserMedia mock result manipulation to the LayoutTestController
Product: WebKit Reporter: Leandro GraciĆ” Gil <leandrogracia>
Component: Tools / TestsAssignee: Tommy Widenflycht <tommyw>
Status: RESOLVED WONTFIX    
Severity: Normal CC: abarth, danilo.eu, dglazkov, donggwan.kim, fishd, gustavo, harald, morrita, rakuco, s.choi, sh9.choi, tkent, webkit.review.bot, wjjeon, xan.lopez, yujie.mao
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 61069    
Bug Blocks: 56459, 56587    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch gustavo: commit-queue-

Leandro GraciĆ” Gil
Reported 2011-05-18 09:31:58 PDT
Add a new method to the different ports of the LayoutTestController to set the available mock devices in the next navigator.getUserMedia call. This will be used through many layout tests.
Attachments
Patch (43.03 KB, patch)
2012-02-16 06:56 PST, Tommy Widenflycht
no flags
Patch (50.50 KB, patch)
2012-02-16 08:00 PST, Tommy Widenflycht
no flags
Patch (50.56 KB, patch)
2012-02-17 01:13 PST, Tommy Widenflycht
no flags
Patch (50.56 KB, patch)
2012-02-17 05:27 PST, Tommy Widenflycht
no flags
Patch (51.42 KB, patch)
2012-02-20 02:03 PST, Tommy Widenflycht
no flags
Patch (52.53 KB, patch)
2012-02-23 01:58 PST, Tommy Widenflycht
no flags
Patch (52.61 KB, patch)
2012-02-27 04:29 PST, Tommy Widenflycht
no flags
Patch (40.57 KB, patch)
2012-02-29 07:12 PST, Tommy Widenflycht
gustavo: commit-queue-
Tommy Widenflycht
Comment 1 2012-02-16 06:56:27 PST
WebKit Review Bot
Comment 2 2012-02-16 07:12:19 PST
Comment on attachment 127372 [details] Patch Attachment 127372 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/11542004
Gyuyoung Kim
Comment 3 2012-02-16 07:19:56 PST
Tommy Widenflycht
Comment 4 2012-02-16 08:00:55 PST
WebKit Review Bot
Comment 5 2012-02-16 08:43:38 PST
Comment on attachment 127381 [details] Patch Attachment 127381 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/11536215
Tommy Widenflycht
Comment 6 2012-02-17 01:13:42 PST
WebKit Review Bot
Comment 7 2012-02-17 03:53:50 PST
Comment on attachment 127548 [details] Patch Attachment 127548 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/11538453
Tommy Widenflycht
Comment 8 2012-02-17 04:18:56 PST
Hmm, for some reason the chromium build bot is stuck on an quite old chromium revision...
Tommy Widenflycht
Comment 9 2012-02-17 05:27:12 PST
WebKit Review Bot
Comment 10 2012-02-17 09:43:07 PST
Comment on attachment 127575 [details] Patch Attachment 127575 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/11540498 New failing tests: platform/chromium/media/video-capture-preview.html
Adam Barth
Comment 11 2012-02-17 10:50:40 PST
> Hmm, for some reason the chromium build bot is stuck on an quite old chromium revision... The revision is controlled by this file: http://trac.webkit.org/browser/trunk/Source/WebKit/chromium/DEPS If you find that it's older than you'd like, please update it to a newer revision.
Adam Barth
Comment 12 2012-02-17 10:55:16 PST
Comment on attachment 127575 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=127575&action=review This generally looks good. We'll need fishd to review the API changes. Also, it looks like you're failing one test. > Source/WebKit/chromium/public/WebUserMediaClientMock.h:57 > + WEBKIT_EXPORT virtual void requestUserMedia(const WebUserMediaRequest&, const WebVector<WebMediaStreamSource>& audioSources, const WebVector<WebMediaStreamSource>& videoSources); > + WEBKIT_EXPORT virtual void cancelUserMediaRequest(const WebUserMediaRequest&); You don't need to export virtual functions. They're called indirectly anyway.
Adam Barth
Comment 13 2012-02-17 10:55:38 PST
+fishd for WebKit API review.
Tommy Widenflycht
Comment 14 2012-02-20 02:03:15 PST
Tommy Widenflycht
Comment 15 2012-02-20 02:04:23 PST
Comment on attachment 127575 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=127575&action=review >> Source/WebKit/chromium/public/WebUserMediaClientMock.h:57 >> + WEBKIT_EXPORT virtual void cancelUserMediaRequest(const WebUserMediaRequest&); > > You don't need to export virtual functions. They're called indirectly anyway. Fixed.
Tommy Widenflycht
Comment 16 2012-02-20 02:05:38 PST
(In reply to comment #12) > (From update of attachment 127575 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=127575&action=review > > Also, it looks like you're failing one test. > Sorry about that, I forgot to add that changed test to the patch.
Adam Barth
Comment 17 2012-02-20 19:46:15 PST
I think the ball is in fishd's court here.
Adam Barth
Comment 18 2012-02-22 17:56:43 PST
Comment on attachment 127785 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=127785&action=review One naming nit below, but I don't think its worth re-spinning this patch. Please feel free to address it in a follow-up patch if you think it's worth changing. > Source/WebKit/chromium/src/WebUserMediaClientMock.cpp:32 > +#if ENABLE(MEDIA_STREAM) Missing a blank line above here. > Source/WebKit/chromium/src/WebUserMediaClientMock.cpp:64 > + m_private->setGetUserMediaResult(allowAudio, allowVideo); I wonder if this would read better as "setUserMediaResult". > Tools/DumpRenderTree/chromium/LayoutTestController.cpp:187 > + bindMethod("setMockGetUserMediaResult", &LayoutTestController::setMockGetUserMediaResult); This would then be setMockUserMediaResult, which would make sense.
WebKit Review Bot
Comment 19 2012-02-22 18:21:06 PST
Comment on attachment 127785 [details] Patch Rejecting attachment 127785 [details] from commit-queue. Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2 Last 500 characters of output: edia-arguments.html patching file LayoutTests/fast/mediastream/getusermedia-not-allowed-expected.txt patching file LayoutTests/fast/mediastream/getusermedia-not-allowed.html patching file LayoutTests/fast/mediastream/script-tests/getusermedia-not-allowed.js patching file LayoutTests/platform/chromium/media/video-capture-preview.html Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', u'--force', u'--reviewer', u'Adam Barth']" exit_code: 1 cwd: /mnt/git/webkit-commit-queue/ Full output: http://queues.webkit.org/results/11599057
Tommy Widenflycht
Comment 20 2012-02-23 01:53:18 PST
Comment on attachment 127785 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=127785&action=review >> Source/WebKit/chromium/src/WebUserMediaClientMock.cpp:32 >> +#if ENABLE(MEDIA_STREAM) > > Missing a blank line above here. Fixed. >> Source/WebKit/chromium/src/WebUserMediaClientMock.cpp:64 >> + m_private->setGetUserMediaResult(allowAudio, allowVideo); > > I wonder if this would read better as "setUserMediaResult". Hmm, maybe. The function this sets the expectations for is "getUserMedia" and thus setGetUserMediaResult feels more logical. However I don't feel very strongly about it.
Tommy Widenflycht
Comment 21 2012-02-23 01:58:40 PST
WebKit Review Bot
Comment 22 2012-02-23 14:56:41 PST
Comment on attachment 128437 [details] Patch Rejecting attachment 128437 [details] from commit-queue. Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2 Last 500 characters of output: media-not-allowed-expected.txt patching file LayoutTests/fast/mediastream/getusermedia-not-allowed.html patching file LayoutTests/fast/mediastream/script-tests/Attributes.js patching file LayoutTests/fast/mediastream/script-tests/getusermedia-not-allowed.js patching file LayoutTests/platform/chromium/media/video-capture-preview.html Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', u'--force', u'--reviewer', u'Adam Barth']" exit_code: 1 cwd: /mnt/git/webkit-commit-queue/ Full output: http://queues.webkit.org/results/11603437
Tommy Widenflycht
Comment 23 2012-02-27 04:29:26 PST
WebKit Review Bot
Comment 24 2012-02-27 04:33:28 PST
Please wait for approval from fishd@chromium.org before submitting because this patch contains changes to the Chromium public API.
Tommy Widenflycht
Comment 25 2012-02-27 04:34:34 PST
Just rebased, no actual code changes.
WebKit Review Bot
Comment 26 2012-02-27 05:10:14 PST
Comment on attachment 129012 [details] Patch Attachment 129012 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/11633895 New failing tests: inspector/protocol/console-agent.html
Darin Fisher (:fishd, Google)
Comment 27 2012-02-27 08:41:52 PST
Comment on attachment 129012 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=129012&action=review > Source/WebKit/chromium/public/WebUserMediaClientMock.h:50 > +class WebUserMediaClientMock : public WebUserMediaClient { Why do we have mocks as part of the API? Why isn't this class just part of DumpRenderTree?
Tommy Widenflycht
Comment 28 2012-02-27 10:20:11 PST
I wanted to place the mock next to the code it is coming from, and also there is other code doing the same. The idea to place XxxMock.* in DRT/ main directory and WebXxxMock.* in DRT/chromium just never struck me. I'll give it a shot and report back.
Darin Fisher (:fishd, Google)
Comment 29 2012-02-27 10:23:58 PST
(In reply to comment #28) > I wanted to place the mock next to the code it is coming from, and also there is other code doing the same. The idea to place XxxMock.* in DRT/ main directory and WebXxxMock.* in DRT/chromium just never struck me. > > I'll give it a shot and report back. We have some bad code in the codebase. There doesn't seem to be any point to shipping code for mocks in Chrome. We only need to builds mocks into DRT. What we need is the correct interfaces to support dependency injection so that DRT can supply mock implementations of various layers.
Tommy Widenflycht
Comment 30 2012-02-27 10:26:43 PST
The code will be linked away for everything except DRT though but if we don't have to compile it we save time.
Kent Tamura
Comment 31 2012-02-27 17:28:54 PST
Can we move the mock to WebCore/testing and enable it by window.internals?
Tommy Widenflycht
Comment 32 2012-02-28 01:33:27 PST
After a chat session with Darin yesterday we agreed to make the mock code DRT/chromium only for now and take the refactoring when another port have implemented WebRTC.
Darin Fisher (:fishd, Google)
Comment 33 2012-02-28 11:14:25 PST
(In reply to comment #32) > After a chat session with Darin yesterday we agreed to make the mock code DRT/chromium only for now and take the refactoring when another port have implemented WebRTC. To be clear, I'm also OK with tkent's suggestion!
Darin Fisher (:fishd, Google)
Comment 34 2012-02-28 11:15:02 PST
Comment on attachment 129012 [details] Patch marking R- based on decision to move mocks out.
Tommy Widenflycht
Comment 35 2012-02-29 07:12:13 PST
Tommy Widenflycht
Comment 36 2012-02-29 07:14:17 PST
Hi all reviewers, I gave the move to WebCore/testing a try. What do you think?
Adam Barth
Comment 37 2012-02-29 10:27:52 PST
Comment on attachment 129440 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=129440&action=review > Source/WebCore/testing/InternalSettings.idl:44 > + void setMockGetUserMediaResult(in boolean audio, in boolean video) raises(DOMException); I think previously this object has been used to manipulate WebCore::Settings, no mocks. I wonder if we should create a new IDL for manipulating mocks?
Adam Barth
Comment 38 2012-02-29 10:28:26 PST
+morrita,dglazkov as this relates to WebCore::Internals.
Gustavo Noronha (kov)
Comment 39 2012-02-29 16:45:48 PST
Kent Tamura
Comment 40 2012-02-29 16:58:45 PST
Comment on attachment 129440 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=129440&action=review > Source/WebKit/chromium/src/WebUserMediaClientMock.cpp:1 > +/* This isn't used anymore? > Tools/DumpRenderTree/chromium/WebViewHost.h:254 > + WebKit::WebUserMediaClientMock* userMediaClientMock(); This isn't used anymore?
Note You need to log in before you can comment on or make changes to this bug.