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

Issue 209853011: [VideoPlayer] Browser tests for new separated video player app (Closed)

Created:
6 years, 9 months ago by yoshiki
Modified:
6 years, 8 months ago
Reviewers:
mtomasz, hirono
CC:
chromium-reviews, extensions-reviews_chromium.org, nkostylev+watch_chromium.org, yoshiki+watch_chromium.org, rginda+watch_chromium.org, arv+watch_chromium.org, oshima+watch_chromium.org, chromium-apps-reviews_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org
Visibility:
Public.

Description

[VideoPlayer] Browser tests for new separated video player app BUG=357621 TEST=manually tested R=hirono@chromium.org TBR=arv@chromium.org # TBRing for adding a resource. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=260198

Patch Set 1 #

Total comments: 7

Patch Set 2 : Adressed the comment #

Total comments: 13

Patch Set 3 : Adressed the comment #

Patch Set 4 : Rebased #

Patch Set 5 : Rebased #

Patch Set 6 : Rebased #

Messages

Total messages: 26 (0 generated)
yoshiki
@hirono, PTAL. This patch is depending on https://codereview.chromium.org/210623003/.
6 years, 9 months ago (2014-03-25 07:37:47 UTC) #1
hirono
https://codereview.chromium.org/209853011/diff/20001/chrome/browser/resources/video_player/js/test_util.js File chrome/browser/resources/video_player/js/test_util.js (right): https://codereview.chromium.org/209853011/diff/20001/chrome/browser/resources/video_player/js/test_util.js#newcode1 chrome/browser/resources/video_player/js/test_util.js:1: // Copyright 2014 The Chromium Authors. All rights reserved. ...
6 years, 9 months ago (2014-03-25 07:48:16 UTC) #2
yoshiki
https://codereview.chromium.org/209853011/diff/20001/chrome/browser/resources/video_player/js/test_util.js File chrome/browser/resources/video_player/js/test_util.js (right): https://codereview.chromium.org/209853011/diff/20001/chrome/browser/resources/video_player/js/test_util.js#newcode1 chrome/browser/resources/video_player/js/test_util.js:1: // Copyright 2014 The Chromium Authors. All rights reserved. ...
6 years, 9 months ago (2014-03-25 07:53:33 UTC) #3
hirono
https://codereview.chromium.org/209853011/diff/20001/chrome/browser/resources/video_player/js/test_util.js File chrome/browser/resources/video_player/js/test_util.js (right): https://codereview.chromium.org/209853011/diff/20001/chrome/browser/resources/video_player/js/test_util.js#newcode1 chrome/browser/resources/video_player/js/test_util.js:1: // Copyright 2014 The Chromium Authors. All rights reserved. ...
6 years, 9 months ago (2014-03-25 08:02:19 UTC) #4
yoshiki
@hirono, PTAL. Thanks. https://codereview.chromium.org/209853011/diff/20001/chrome/test/data/extensions/api_test/file_manager_browsertest/open_video_files.js File chrome/test/data/extensions/api_test/file_manager_browsertest/open_video_files.js (right): https://codereview.chromium.org/209853011/diff/20001/chrome/test/data/extensions/api_test/file_manager_browsertest/open_video_files.js#newcode38 chrome/test/data/extensions/api_test/file_manager_browsertest/open_video_files.js:38: return Promise.resolve(false); On 2014/03/25 08:02:19, hirono ...
6 years, 9 months ago (2014-03-25 10:07:27 UTC) #5
hirono
https://codereview.chromium.org/209853011/diff/60001/chrome/browser/resources/video_player/js/error_util.js File chrome/browser/resources/video_player/js/error_util.js (right): https://codereview.chromium.org/209853011/diff/60001/chrome/browser/resources/video_player/js/error_util.js#newcode1 chrome/browser/resources/video_player/js/error_util.js:1: // Copyright 2013 The Chromium Authors. All rights reserved. ...
6 years, 9 months ago (2014-03-26 02:55:04 UTC) #6
yoshiki
https://codereview.chromium.org/209853011/diff/60001/chrome/browser/resources/video_player/js/error_util.js File chrome/browser/resources/video_player/js/error_util.js (right): https://codereview.chromium.org/209853011/diff/60001/chrome/browser/resources/video_player/js/error_util.js#newcode1 chrome/browser/resources/video_player/js/error_util.js:1: // Copyright 2013 The Chromium Authors. All rights reserved. ...
6 years, 9 months ago (2014-03-26 04:55:51 UTC) #7
hirono
The newest change is not uploaded? https://codereview.chromium.org/209853011/diff/60001/chrome/browser/resources/video_player/js/error_util.js File chrome/browser/resources/video_player/js/error_util.js (right): https://codereview.chromium.org/209853011/diff/60001/chrome/browser/resources/video_player/js/error_util.js#newcode27 chrome/browser/resources/video_player/js/error_util.js:27: Function.prototype.wrap = function(thisObject) ...
6 years, 9 months ago (2014-03-26 08:18:31 UTC) #8
yoshiki
Sorry, I forgot to upload it. PATL again?
6 years, 9 months ago (2014-03-26 08:45:46 UTC) #9
hirono
lgtm!
6 years, 9 months ago (2014-03-26 08:57:58 UTC) #10
yoshiki
The CQ bit was checked by yoshiki@chromium.org
6 years, 9 months ago (2014-03-26 13:29:49 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yoshiki@chromium.org/209853011/220001
6 years, 9 months ago (2014-03-26 13:29:51 UTC) #12
yoshiki
The CQ bit was unchecked by yoshiki@chromium.org
6 years, 9 months ago (2014-03-26 13:29:54 UTC) #13
yoshiki
The CQ bit was checked by yoshiki@chromium.org
6 years, 9 months ago (2014-03-26 13:30:53 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yoshiki@chromium.org/209853011/220001
6 years, 9 months ago (2014-03-26 13:31:03 UTC) #15
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-26 16:28:37 UTC) #16
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on linux_chromium_chromeos_rel
6 years, 9 months ago (2014-03-26 16:28:38 UTC) #17
yoshiki
The CQ bit was checked by yoshiki@chromium.org
6 years, 9 months ago (2014-03-27 00:24:03 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yoshiki@chromium.org/209853011/220001
6 years, 9 months ago (2014-03-27 00:30:10 UTC) #19
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-27 02:09:55 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on linux_chromium_chromeos_rel
6 years, 9 months ago (2014-03-27 02:09:55 UTC) #21
yoshiki
Committed patchset #6 manually as r260198 (presubmit successful).
6 years, 9 months ago (2014-03-28 18:13:08 UTC) #22
mtomasz
Sorry for late comments. I just came across this CL. https://codereview.chromium.org/209853011/diff/60001/chrome/browser/resources/video_player/js/error_util.js File chrome/browser/resources/video_player/js/error_util.js (right): https://codereview.chromium.org/209853011/diff/60001/chrome/browser/resources/video_player/js/error_util.js#newcode27 ...
6 years, 8 months ago (2014-04-01 19:37:49 UTC) #23
yoshiki
On 2014/04/01 19:37:49, mtomasz wrote: > Sorry for late comments. I just came across this ...
6 years, 8 months ago (2014-04-02 04:20:10 UTC) #24
mtomasz
On 2014/04/02 04:20:10, yoshiki wrote: > On 2014/04/01 19:37:49, mtomasz wrote: > > Sorry for ...
6 years, 8 months ago (2014-04-02 04:42:25 UTC) #25
yoshiki
6 years, 8 months ago (2014-04-02 06:07:31 UTC) #26
Message was sent while issue was closed.
On 2014/04/02 04:42:25, mtomasz wrote:
> On 2014/04/02 04:20:10, yoshiki wrote:
> > On 2014/04/01 19:37:49, mtomasz wrote:
> > > Sorry for late comments. I just came across this CL.
> > > 
> > >
> >
>
https://codereview.chromium.org/209853011/diff/60001/chrome/browser/resources...
> > > File chrome/browser/resources/video_player/js/error_util.js (right):
> > > 
> > >
> >
>
https://codereview.chromium.org/209853011/diff/60001/chrome/browser/resources...
> > > chrome/browser/resources/video_player/js/error_util.js:27:
> > > Function.prototype.wrap = function(thisObject) {
> > > On 2014/03/26 08:18:31, hirono wrote:
> > > > On 2014/03/26 04:55:52, yoshiki wrote:
> > > > > On 2014/03/26 02:55:05, hirono wrote:
> > > > > > Strictly our design guide forbid us to modify prototypes of builtin
> > > objects.
> > > > > >
> > > > >
> > > >
> > >
> >
>
https://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml?showon...
> > > > > 
> > > > > Not "strictly". The guide says "Modifying other builtins like
> > > > Function.prototype
> > > > > is less dangerous".
> > > > > 
> > > > > Of cause, we can instead use a normal function like wrap(func,
thisObj).
> > But
> > > > I'm
> > > > > considering to replace bind() with wrap() in Files.app as well as in
> video
> > > > > player. Along the way, the same syntax as bind() is better to replace
> it,
> > > > since
> > > > > the only thing we need to do it replacing of the text.
> > > > 
> > > > SGTM. 
> > > 
> > > Out of curiosity. Why don't we put this code to #16? Is there any
advantage
> of
> > > wrap() over window.onerror?
> > 
> > There are 2 advantages.
> > 
> > (1) 
> > window.onerror is DOM error handler so it doesn't catch an exception in the
> > handler of non-DOM async function.
> > 
> > // Example1, error in handler of DOM async function
> > var count = 0;
> > window.onerror = function() { count++; }
> > setTimeout(function() { throw 'error'; }); // DOM function
> > setTimeout(function() { assert(count == 1); }, 100);
> > 
> > 
> > // Example2, error in handler of non-DOM async function
> > var count = 0;
> > window.onerror = function() { count++; }
> > chrome.local.storage.get(function() { throw 'error'; }); // non-DOM function
> > setTimeout(function() { assert(count == 0); }, 100);  // The exception is
not
> > caught!
> 
> Thanks for the explanation. This is very interesting, I didn't know about it.
> Looks like a bug in Chrome.

I assume it is by design, not a bug. But I have no clue.

> > (2) we can know the stack trace of caller in case of error. 
> 
> We can access the stacktrace via window.onerror, using the 5th argument. It
> seems to be a very recently added feature.
> http://html5.org/tools/web-apps-tracker?from=8085&to=8086

The 5th argument seems the stacktrace of inside handler. What we want to know
here is the stacktrace of the callee (= async function), in my example, the
stacktrace of setTimeout and chrome.local.storage.get.

In tot, we can see an async stacktrace in inspector:
https://code.google.com/p/chromium/issues/detail?id=272416.
But it doesn't appear on console.

> > 
> > 
> > > I'm a little bit concerned about violating the style guide here, which
> clearly
> > > says No for modifying prototypes of builtin types. Can't we avoid it?
> > > 
> > >
> >
>
https://codereview.chromium.org/209853011/diff/60001/chrome/browser/resources...
> > > chrome/browser/resources/video_player/js/error_util.js:39:
> > > window.JSErrorCount++;
> > > Aren't we incrementing JSErrorCount twice? #16 and #39?
> > 
> > I think double-counting is not a problem for this count, since what we want
to
> > know is whether any error is happened or not. But I agreed that it looks
> > confusing. I think it's better to add a comment.
> 
> If so, then how about changing to bool, to avoid confusion?

I think, number may help debugging in some case even if it is rough. How about
changing the name to 'JSErrorRoughCount'?

Powered by Google App Engine
This is Rietveld 408576698