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

Issue 1128543002: Blank UI for web component tests. (Closed)

Created:
5 years, 7 months ago by michaelpg
Modified:
5 years, 6 months ago
Reviewers:
stevenjb, James Hawkins
CC:
chromium-reviews, arv+watch_chromium.org, stevenjb, Jeremy Klein, Oren Blasberg, Kyle Horimoto, Dan Beam
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Blank UI for web component tests. This UI will let us test a variety of Polymer elements by navigating to this UI in a browser test, then including the files to test. Many of the files we want to test include chrome:// URLs, which is why this WebUI is useful to have. This is the first of 3 CLs to enable support for testing web components in Chrome. chrome://web-component-test/ will be augmented to work with Mocha and provide a simple framework for async Polymer tests. BUG=482770

Patch Set 1 #

Patch Set 2 #

Patch Set 3 : rebase #

Total comments: 2

Patch Set 4 : Alphabetize #

Patch Set 5 : rebase #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+55 lines, -0 lines) Patch
M chrome/browser/browser_resources.grd View 1 chunk +1 line, -0 lines 0 comments Download
A chrome/browser/resources/web_component_test.html View 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc View 1 2 3 2 chunks +3 lines, -0 lines 2 comments Download
A chrome/browser/ui/webui/web_component_test_ui.h View 1 chunk +20 lines, -0 lines 0 comments Download
A chrome/browser/ui/webui/web_component_test_ui.cc View 1 1 chunk +21 lines, -0 lines 0 comments Download
M chrome/chrome_browser_ui.gypi View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/common/url_constants.h View 1 2 3 4 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/common/url_constants.cc View 1 2 3 4 2 chunks +2 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (3 generated)
michaelpg
Part One.
5 years, 7 months ago (2015-05-05 12:12:46 UTC) #2
stevenjb
lgtm with comment https://codereview.chromium.org/1128543002/diff/40001/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc File chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc (right): https://codereview.chromium.org/1128543002/diff/40001/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc#newcode306 chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc:306: return &NewWebUI<WebComponentTestUI>; Either alphabetize this or ...
5 years, 7 months ago (2015-05-05 22:25:00 UTC) #4
michaelpg
https://codereview.chromium.org/1128543002/diff/40001/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc File chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc (right): https://codereview.chromium.org/1128543002/diff/40001/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc#newcode306 chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc:306: return &NewWebUI<WebComponentTestUI>; On 2015/05/05 22:25:00, stevenjb wrote: > Either ...
5 years, 7 months ago (2015-05-08 16:57:39 UTC) #5
michaelpg
@jhawkins: ping
5 years, 7 months ago (2015-05-14 03:05:58 UTC) #7
James Hawkins
https://codereview.chromium.org/1128543002/diff/100001/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc File chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc (right): https://codereview.chromium.org/1128543002/diff/100001/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc#newcode360 chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc:360: if (url.host() == chrome::kChromeUIWebComponentTestHost) How can we mitigate this ...
5 years, 7 months ago (2015-05-14 15:16:09 UTC) #8
michaelpg
https://codereview.chromium.org/1128543002/diff/100001/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc File chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc (right): https://codereview.chromium.org/1128543002/diff/100001/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc#newcode360 chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc:360: if (url.host() == chrome::kChromeUIWebComponentTestHost) On 2015/05/14 15:16:09, James Hawkins ...
5 years, 7 months ago (2015-05-14 19:06:31 UTC) #9
James Hawkins
On 2015/05/14 19:06:31, michaelpg wrote: > https://codereview.chromium.org/1128543002/diff/100001/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc > File chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc (right): > > https://codereview.chromium.org/1128543002/diff/100001/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc#newcode360 > ...
5 years, 7 months ago (2015-05-15 18:00:28 UTC) #10
michaelpg
5 years, 7 months ago (2015-05-19 03:06:32 UTC) #11
On 2015/05/15 18:00:28, James Hawkins wrote:
> On 2015/05/14 19:06:31, michaelpg wrote:
> >
>
https://codereview.chromium.org/1128543002/diff/100001/chrome/browser/ui/webu...
> > File chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc (right):
> > 
> >
>
https://codereview.chromium.org/1128543002/diff/100001/chrome/browser/ui/webu...
> > chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc:360: if
> (url.host()
> > == chrome::kChromeUIWebComponentTestHost)
> > On 2015/05/14 15:16:09, James Hawkins wrote:
> > > How can we mitigate this being accessible outside of a testing
environment? 
> > I'm
> > > concerned about the security implications of this infrastructure.
> > 
> > We could put it behind a flag, but I don't think that's warranted. This is a
> > blank Web UI so it can't do anything more than other Web UI can do.
> > 
> > In a follow-up CL we'll add mocha.js to this UI. So separately, we should
> figure
> > out a way to only include mocha when needed for testing. That discussion is
> > here:
> >
>
https://codereview.chromium.org/1124873002/diff/80001/chrome/browser/browser_...
> 
> There is probably an easier way to exclude these files from the prod build. 
We
> don't include test files; how does that happen?

I've figured out the right way to load Mocha files in browser_tests so they're
not part of the chrome binary. But for this CL specifically, we want the WebUI
in the chrome binary. We could exclude it from buildtype=Official, is that good
enough?

>  I'm mostly concerned about
> unknown security risks, so I think we should run this by Chrome security.

I'm happy to do that.

>  I'm
> also not a fan of having this test code contribute to the binary size
increase,
> even though it's relatively small...death by a thousand cuts and whatnot.

fair point. If we limit our testing to non-official builds we'd only increase
the size of non-"buildtype=Official" binaries.

This WebUI isn't strictly necessary. We could navigate to any chrome:// WebUI to
import the Polymer components to test. My original example went to
chrome://chrome-urls and set document.body.innerText=''. But that seems too
hacky, and IMO the cost of this CL is minor. I'm still open to suggestions
though -- we need something that makes sense across the board.

Powered by Google App Engine
This is Rietveld 408576698