Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Issue 1692773002: Canvas Capture: chrome browsertest- added frame rate test (Closed)

Created:
4 years, 10 months ago by cpaulin (no longer in chrome)
Modified:
4 years, 9 months ago
CC:
chromium-reviews, posciak+watch_chromium.org, feature-media-reviews_chromium.org, tnakamura+watch_chromium.org, phoglund+watch_chromium.org, mcasas+watch_chromium.org, Lei Zhang
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Canvas Capture: chrome browsertest- added frame rate test This CL introduces a new chrome browser test for canvas capture. The test verifies that the canvas capture frame rate is as expected. BUG=524218, 586316 TEST=On linux host and trybots Committed: https://crrev.com/7a05c134dedd0137c23ba43b42db8f1e513cd9e6 Cr-Commit-Position: refs/heads/master@{#379065}

Patch Set 1 : New frame rate test for canvas capture. #

Total comments: 14

Patch Set 2 : Addressed phoglund@'s comments. #

Patch Set 3 : Fixed incorrect logging of tolerance percentage. #

Total comments: 3

Patch Set 4 : Addressed emircan@'s comments and phoglund@'s comment #

Patch Set 5 : Excluding mac trybots for now. #

Total comments: 32
Unified diffs Side-by-side diffs Delta from patch set Stats (+223 lines, -0 lines) Patch
A chrome/browser/media/chrome_webrtc_canvas_capture_browsertest.cc View 1 2 3 4 1 chunk +79 lines, -0 lines 12 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
A + chrome/test/data/media/bear-640x360.webm View Binary file 0 comments Download
A chrome/test/data/media/canvas_capture_test.html View 1 2 3 1 chunk +143 lines, -0 lines 20 comments Download

Messages

Total messages: 41 (18 generated)
cpaulin (no longer in chrome)
Hi, Canvas Capture: added frame rate test. My first browser test, hopefully not too much ...
4 years, 10 months ago (2016-02-12 05:34:22 UTC) #7
phoglund_chromium
I think the code is fine in general, but you need to think very carefully ...
4 years, 10 months ago (2016-02-12 08:38:53 UTC) #8
cpaulin (no longer in chrome)
On 2016/02/12 08:38:53, phoglund_chrome wrote: > I think the code is fine in general, but ...
4 years, 10 months ago (2016-02-12 17:54:13 UTC) #9
cpaulin (no longer in chrome)
Patch set 2 is ready for review. https://codereview.chromium.org/1692773002/diff/80001/chrome/browser/media/chrome_webrtc_canvas_capture_browsertest.cc File chrome/browser/media/chrome_webrtc_canvas_capture_browsertest.cc (right): https://codereview.chromium.org/1692773002/diff/80001/chrome/browser/media/chrome_webrtc_canvas_capture_browsertest.cc#newcode31 chrome/browser/media/chrome_webrtc_canvas_capture_browsertest.cc:31: class WebRtcCanvasCaptureBrowserTest ...
4 years, 10 months ago (2016-02-12 20:14:32 UTC) #10
phoglund_chromium
lgtm https://codereview.chromium.org/1692773002/diff/120001/chrome/test/data/media/canvas_capture_test.html File chrome/test/data/media/canvas_capture_test.html (right): https://codereview.chromium.org/1692773002/diff/120001/chrome/test/data/media/canvas_capture_test.html#newcode113 chrome/test/data/media/canvas_capture_test.html:113: averageDroppedFPS + ' instead'); Nit: indent 4
4 years, 10 months ago (2016-02-15 08:05:44 UTC) #11
cpaulin (no longer in chrome)
Emircan, Please review canvas capture browser test Thanks Christian
4 years, 10 months ago (2016-02-16 06:14:14 UTC) #13
emircan
lgtm % a question. https://codereview.chromium.org/1692773002/diff/120001/chrome/test/data/media/canvas_capture_test.html File chrome/test/data/media/canvas_capture_test.html (right): https://codereview.chromium.org/1692773002/diff/120001/chrome/test/data/media/canvas_capture_test.html#newcode113 chrome/test/data/media/canvas_capture_test.html:113: averageDroppedFPS + ' instead'); If ...
4 years, 10 months ago (2016-02-16 22:21:48 UTC) #14
cpaulin (no longer in chrome)
https://codereview.chromium.org/1692773002/diff/120001/chrome/test/data/media/canvas_capture_test.html File chrome/test/data/media/canvas_capture_test.html (right): https://codereview.chromium.org/1692773002/diff/120001/chrome/test/data/media/canvas_capture_test.html#newcode113 chrome/test/data/media/canvas_capture_test.html:113: averageDroppedFPS + ' instead'); On 2016/02/16 22:21:47, emircan wrote: ...
4 years, 10 months ago (2016-02-16 23:48:29 UTC) #15
cpaulin (no longer in chrome)
I am going to produce one more patch set for this CL to address a ...
4 years, 10 months ago (2016-02-17 18:04:10 UTC) #17
cpaulin (no longer in chrome)
Hi, I addresses the last nits in patch set 4
4 years, 10 months ago (2016-02-17 22:18:19 UTC) #18
emircan
On 2016/02/17 22:18:19, cpaulin wrote: > Hi, > I addresses the last nits in patch ...
4 years, 10 months ago (2016-02-17 23:00:38 UTC) #19
phoglund_chromium
ship it
4 years, 10 months ago (2016-02-18 08:49:46 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1692773002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1692773002/140001
4 years, 10 months ago (2016-02-19 22:40:45 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/182930)
4 years, 10 months ago (2016-02-19 23:50:04 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1692773002/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1692773002/180001
4 years, 9 months ago (2016-03-03 19:08:41 UTC) #29
commit-bot: I haz the power
Committed patchset #5 (id:180001)
4 years, 9 months ago (2016-03-03 20:03:08 UTC) #31
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/7a05c134dedd0137c23ba43b42db8f1e513cd9e6 Cr-Commit-Position: refs/heads/master@{#379065}
4 years, 9 months ago (2016-03-03 20:04:26 UTC) #33
benwells
A revert of this CL (patchset #5 id:180001) has been created in https://codereview.chromium.org/1762703004/ by benwells@chromium.org. ...
4 years, 9 months ago (2016-03-04 02:32:03 UTC) #34
kjellander_chromium
On 2016/03/04 02:32:03, benwells wrote: > A revert of this CL (patchset #5 id:180001) has ...
4 years, 9 months ago (2016-03-04 13:01:01 UTC) #35
chromium-reviews
Interesting, I will try to reproduce On Fri, Mar 4, 2016 at 5:01 AM, <kjellander@chromium.org> ...
4 years, 9 months ago (2016-03-04 20:28:49 UTC) #36
chromium-reviews
kjellander@ - what if the value is correct but moves up/down over time, what would ...
4 years, 9 months ago (2016-03-04 21:41:01 UTC) #37
mcasas
https://codereview.chromium.org/1692773002/diff/180001/chrome/browser/media/chrome_webrtc_canvas_capture_browsertest.cc File chrome/browser/media/chrome_webrtc_canvas_capture_browsertest.cc (right): https://codereview.chromium.org/1692773002/diff/180001/chrome/browser/media/chrome_webrtc_canvas_capture_browsertest.cc#newcode16 chrome/browser/media/chrome_webrtc_canvas_capture_browsertest.cc:16: #include "content/public/browser/render_process_host.h" I'm not sure all these includes are ...
4 years, 9 months ago (2016-03-04 22:30:34 UTC) #39
cpaulin (no longer in chrome)
4 years, 9 months ago (2016-03-10 22:21:25 UTC) #40
Message was sent while issue was closed.
This CL is closed, trying to reland it in
https://codereview.chromium.org/1764983003/
I addressed comments in new CL and disabled MSAN/ASAN
Thanks
Christian

https://codereview.chromium.org/1692773002/diff/180001/chrome/browser/media/c...
File chrome/browser/media/chrome_webrtc_canvas_capture_browsertest.cc (right):

https://codereview.chromium.org/1692773002/diff/180001/chrome/browser/media/c...
chrome/browser/media/chrome_webrtc_canvas_capture_browsertest.cc:16: #include
"content/public/browser/render_process_host.h"
On 2016/03/04 22:30:33, mcasas wrote:
> I'm not sure all these includes are needed. There's 
> no reference to RenderProcessHost for example.
> Perhaps taken from another test?
I pruned the not needed includes. Done.

https://codereview.chromium.org/1692773002/diff/180001/chrome/browser/media/c...
chrome/browser/media/chrome_webrtc_canvas_capture_browsertest.cc:36: // At this
time this browser test verifies that the frame rate of a stream
On 2016/03/04 22:30:33, mcasas wrote:
> I'm surprised to read "At this time". Maybe you could 
> rephrase as 
> 
> // Verifies the frame of a Media Stream created out of a <canvas>.
> // TODO(cpaulin): .Extend this test to...

That's fine, this was indeed not necessary info. Done

https://codereview.chromium.org/1692773002/diff/180001/chrome/browser/media/c...
chrome/browser/media/chrome_webrtc_canvas_capture_browsertest.cc:38: class
MAYBE_WebRtcCanvasCaptureBrowserTest : public InProcessBrowserTest {
On 2016/03/04 22:30:33, mcasas wrote:
> The name of the test does not match the file name.
> This is also true of other files in this folder, so I 
> made a CL to clean that up: http://crrev.com/1762413002

OK, I follow your example CL now. Done

https://codereview.chromium.org/1692773002/diff/180001/chrome/browser/media/c...
chrome/browser/media/chrome_webrtc_canvas_capture_browsertest.cc:43:
command_line->AppendSwitch(switches::kUseGpuInTests);
On 2016/03/04 22:30:33, mcasas wrote:
> Someone else says: 
> // This test enables switches::kUseGpuInTests which causes false positives
> // with MemorySanitizer.
> 
> in
>
https://code.google.com/p/chromium/codesearch#search/&sq=package:chromium&typ...
> which could be the issue.

Thanks for the heads up.
Done.

https://codereview.chromium.org/1692773002/diff/180001/chrome/browser/media/c...
chrome/browser/media/chrome_webrtc_canvas_capture_browsertest.cc:60: }
On 2016/03/04 22:30:33, mcasas wrote:
> I was thinking this looks strangely indented and rightly so:
> 
>   std::string ExecuteJavascript(const std::string& javascript,
>                                 content::WebContents* tab_contents) const {
>     std::string result;
>     EXPECT_TRUE(content::ExecuteScriptAndExtractString(tab_contents,
javascript,
>                                                        &result));
>     return result;
>   }
> 
> 
> is correct.
> 
> I strongly suggest you run
> git cl format 
> before uploading your patch.

Done.

https://codereview.chromium.org/1692773002/diff/180001/chrome/browser/media/c...
chrome/browser/media/chrome_webrtc_canvas_capture_browsertest.cc:63:
DISALLOW_COPY_AND_ASSIGN(MAYBE_WebRtcCanvasCaptureBrowserTest);
On 2016/03/04 22:30:33, mcasas wrote:
> nit: this is one space too far right.

Done.

https://codereview.chromium.org/1692773002/diff/180001/chrome/test/data/media...
File chrome/test/data/media/canvas_capture_test.html (right):

https://codereview.chromium.org/1692773002/diff/180001/chrome/test/data/media...
chrome/test/data/media/canvas_capture_test.html:1: <!DOCTYPE html>
On 2016/03/04 22:30:33, mcasas wrote:
> This file should go into
> chrome/test/data/media/html, don't you think?
> 
> Why isn't in chrome/test/data/webrtc?
> 
> And someone should move
> the webms and mp4s of chrome/test/data/media
> into chrome/test/data/media/resources.

I have the feeling chrome/test/data/webrtc is where the webrtc audio/video
quality test lives, not sure if we should put it there. On the other hand
chrome/test/data/media/html would be a good spot so that's where I am moving it
to.

https://codereview.chromium.org/1692773002/diff/180001/chrome/test/data/media...
chrome/test/data/media/canvas_capture_test.html:9: <source
src='bear-640x360.webm' type='video/webm'>
On 2016/03/04 22:30:33, mcasas wrote:
> What's the problem with the other bear webms around
>
https://code.google.com/p/chromium/codesearch#chromium/src/chrome/test/data/l...
> ?

They don't work, I tried them on linux and mac. What I mean is that they don't
output any visible video, don't know why.

https://codereview.chromium.org/1692773002/diff/180001/chrome/test/data/media...
chrome/test/data/media/canvas_capture_test.html:13: <canvas id='canvas'
width=640 height=360></canvas>
On 2016/03/04 22:30:33, mcasas wrote:
> Large canvas, for a browsertests that is supposed
> to verify functionality. Larger canvases mean slower
> tests, what about 320x240? Or 160x120?

I will look for a smaller video.
Done.

https://codereview.chromium.org/1692773002/diff/180001/chrome/test/data/media...
chrome/test/data/media/canvas_capture_test.html:22: var TOLERANCE_PERCENT = 15 /
100;
On 2016/03/04 22:30:33, mcasas wrote:
> This is not a percentage, but a per_one in 
> any case :)
> Just call it tolerance.

Done.

https://codereview.chromium.org/1692773002/diff/180001/chrome/test/data/media...
chrome/test/data/media/canvas_capture_test.html:45: this.theCanvasStream = null;
On 2016/03/04 22:30:33, mcasas wrote:
> Inconsistent indenting: here you use 2 spaces
> whereas in drat() and onload (for example) you
> are using 4.

window.onload indent is a line break not a typical function declaration and
accordingly the line break requires 4 spaces.
But you are right that function draw() {...} had wacko indents.
Done

https://codereview.chromium.org/1692773002/diff/180001/chrome/test/data/media...
chrome/test/data/media/canvas_capture_test.html:57: var test = this;
On 2016/03/04 22:30:33, mcasas wrote:
> Why aliasing? In l. 100+ you use |this|.
> Const?

Reason is this would not work:
testVideo.addEventListener('play', function(event) {
      this.startTime = new Date().getTime();
      this.interval = setInterval(this.calculateStats.bind(this, testVideo),
          1000);
    });

Because 'this' means different things to different objects. I am taker of a
better solution if any.
Done.

https://codereview.chromium.org/1692773002/diff/180001/chrome/test/data/media...
chrome/test/data/media/canvas_capture_test.html:58: test.targetFPS = frameRate ?
frameRate : DEFAULT_FRAME_RATE;
On 2016/03/04 22:30:33, mcasas wrote:
> This function is only called by
> testFrameRateOfCanvasCapture()
> and that in turn is only called with
> no arguments so this line is superfluous.

I could remove the argument, it is not used in this test.
Done.

https://codereview.chromium.org/1692773002/diff/180001/chrome/test/data/media...
chrome/test/data/media/canvas_capture_test.html:74: if (this.decodedFPS.length
== 6) {
On 2016/03/04 22:30:33, mcasas wrote:
> Make a const out of this, put it on top of file?

Done.

https://codereview.chromium.org/1692773002/diff/180001/chrome/test/data/media...
chrome/test/data/media/canvas_capture_test.html:80: return;
On 2016/03/04 22:30:33, mcasas wrote:
> Uncertain about this but: {} around?
> (due to multiline condition)

Done.

https://codereview.chromium.org/1692773002/diff/180001/chrome/test/data/media...
chrome/test/data/media/canvas_capture_test.html:121: for (var i = 0; i < count;
i++) {
On 2016/03/04 22:30:33, mcasas wrote:
> for (value i in array)
>   ...
> 
> https://google.github.io/styleguide/javascriptguide.xml#for-in_loop

Done.

Powered by Google App Engine
This is Rietveld 408576698