New issue
Advanced search Search tips

Issue 721542 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Aug 14
Cc:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

views::ViewTestBase crashes when used inside of ash_unittests

Project Member Reported by jdufault@chromium.org, May 11 2017

Issue description

Create a new test inside of ash, ie,

    TEST_F(views::ViewTestBase, Foo) {}

This will crash when run inside of mus, ie,

    $ ./out/Release/ash_unittests --gtest_filter=Foo --mus

The stack trace is:

    [91618:91618:0511/140325.345282:2688740223423:FATAL:x11_window_ozone.cc(23)] Check failed: window_manager.
    #0 0x7f84f3b23e8c base::debug::StackTrace::StackTrace()
    #1 0x7f84f3b480e1 logging::LogMessage::~LogMessage()
    #2 0x7f84ef066392 ui::X11WindowOzone::X11WindowOzone()
    #3 0x7f84f1b0f829 ui::(anonymous namespace)::OzonePlatformX11::CreatePlatformWindow()
    #4 0x7f84f2acb064 aura::WindowTreeHostPlatform::WindowTreeHostPlatform()
    #5 0x7f84f2acb010 aura::WindowTreeHost::Create()
    #6 0x0000007c1234 aura::TestScreen::CreateHostForPrimaryDisplay()
    #7 0x0000007bfce1 aura::test::AuraTestHelper::SetUp()
    #8 0x0000007bf576 views::ViewsTestHelperAura::SetUp()
    #9 0x0000007bf34a views::ScopedViewsTestHelper::ScopedViewsTestHelper()
    #10 0x0000007bea65 views::ViewsTestBase::SetUp()
    #11 0x00000073e1fb testing::Test::Run()
    #12 0x00000073e8cf testing::TestInfo::Run()
    #13 0x00000073ecee testing::TestCase::Run()
    #14 0x0000007429ac testing::internal::UnitTestImpl::RunAllTests()
    #15 0x0000007426a7 testing::UnitTest::Run()
    #16 0x000000768e0d base::TestSuite::Run()
    #17 0x00000076a14d base::LaunchUnitTests()
    #18 0x00000053f079 main
    #19 0x7f84f0eaff45 __libc_start_main
    #20 0x0000004a263d <unknown>
 
Cc: -jonr...@chromium.org kylec...@chromium.org jamescook@chromium.org sky@chromium.org
Labels: -Pri-3 OS-Chrome Pri-2
Owner: jonr...@chromium.org
jonross/kylechar - Is this supposed to work? If so, we ought to fix it. If not, we should add CHECKs in test base classes that assert that we're not running with mus.

jdufault, this works when running ash_unittests without --mus, right?

Right, this works without --mus
I'm not aware of ViewsTestBase being used within the ash_unittests binary. I do not feel that it is appropriate, as you would not be bringing up the entire ash shell.

If there is a test that only requires the views stack I would recommend having it in the views_unittests.

In general though a ViewsTestBase in ash_unittests --mus is not supported. Both test suites have extra startup work to ensure that the --mus environment is prepared. And this mix skips both of those paths.
Cc: jonr...@chromium.org
Owner: jdufault@chromium.org
jonross, is there some kind of CHECK you could add that you're running a test in --mus (or --mash) that expects a window server or window manager, and prints a log message that that is the problem and you might be in the wrong test suite?

Also, there are a large number of unit tests in chrome/browser/ui that derive from views::ViewsTestBase. Are those going to work?

kylechar@ thoughts on an appropriate place in the display code to place that warning?

As for chrome/browser/ui those seemt to be in unit_tests. I'm not sure if anyone has tried that suite yet. I would not be surprised if we need to update that suite for --mus, and that ViewsTestBase doesn't work there right now.

views_mus_test_suite.h does a bunch of initial setup to get things working for --mus for example

Comment 7 by sky@chromium.org, May 12 2017

The way to get ViewsTestBase to work with mus is to use ViewsMusTestSuite. Maybe we need to extract that code out into its own class if other places need to use it. An alternative is to key off a switch like --mus (we do this in ash_test_suite).
Status: WontFix (was: Assigned)
We have ViewsTestBase running inside ash_unittests today and --mus doesn't exist anymore. Likely not relevant.

Sign in to add a comment