New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 692895 link

Starred by 2 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Chrome
Pri: 2
Type: Feature



Sign in to add a comment

Remove test dependencies from content_shell_lib

Project Member Reported by michae...@chromium.org, Feb 16 2017

Issue description

content_shell_lib is marked "testonly", so targets that depend on it must also be "testonly" (for example, app_shell via //extensions/shell:app_shell_lib).

Apparently, a bunch of test support is compiled into content_shell, and content_shell itself depends on testonly targets like:

    "//components/test_runner:test_runner",
    "//content/test:content_test_mojo_bindings",
    "//content/test:layouttest_support",
    "//content/test:test_support",
    "//testing/gmock",
    "//testing/gtest",
    "//third_party/WebKit/public:test_support",

Some of this code executes behind the --run-layout-test switch via switches::IsRunLayoutTestSwitchPresent(), which has a TODO for this in shell_switches.h[1].

content/shell/browser/shell.cc has several calls to switches::IsRunLayoutTestSwitchPresent() and #includes a bunch of files in content/shell/browser/layout_test.

Because AppShell -- which we hope to start shipping to some clients in the near future -- uses content_shell_lib, it includes all this test support, too.

Can we move these test dependencies to a separate target, either by #ifdefs in the //content code that does test stuff, or by moving this test stuff out of those files? Is there a good reason not to?

[1] https://cs.chromium.org/chromium/src/content/shell/common/shell_switches.h?type=cs&q=todo&sq=package:chromium&l=27
 
Wondering if part of the problem is that content_shell uses Test* objects as stubs. For instance, shell_platform_data_aura.cc unconditionally creates an aura::test::TestFocusClient() rather than using some non-test focus client.

https://cs.chromium.org/chromium/src/content/shell/browser/shell_platform_data_aura.cc?q=TsetFocusClient&sq=package:chromium&l=69&dr=C

Comment 2 by st...@chromium.org, Mar 3 2017

Cc: r...@chromium.org

Comment 3 by st...@chromium.org, Mar 3 2017

Cc: -st...@chromium.org
Also investigating the alternative of removing app_shell's dependency on content_shell_lib: writing our own shell, sharing what we can with other shells but not directly depending on //content/shell. (But still using the content library itself, of course.)
Cc: nick@chromium.org a...@chromium.org alex...@chromium.org creis@chromium.org
<adding more //content owners to CC>

Sorry for missing this bug earlier.  I think that anything that is useful for supporting a generic shell / supporting generic //content embedders should be exposed via public API of //content (rather than hiding such generally useful things inside //content/shell).  OTOH, I am not really a //content/OWNER, so take what I say with a grain of salt :-)

Sign in to add a comment