New issue
Advanced search Search tips

Issue 598421 link

Starred by 3 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Aug 13
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug
mus



Sign in to add a comment

mash: Allow mash_unittests to use AuraTestBase, ViewsTestBase, etc.

Project Member Reported by jamescook@chromium.org, Mar 28 2016

Issue description

Right now mash_unittests just initializes itself as a mojo shelltest. It apparently doesn't init GL in such a way that you can create Aura windows. In particular attempting to use ViewsTestBase or AuraTestBase results in this:

[10010:10010:0328/135445:965508245200:FATAL:in_process_context_factory.cc(94)] Check failed: gfx::GetGLImplementation() != gfx::kGLImplementationNone (0 vs. 0)If running tests, ensure that main() is calling gfx::GLSurfaceTestSupport::InitializeOneOff()
#0 0x7f528ec6c03e base::debug::StackTrace::StackTrace()
#1 0x7f528ecc1c3c logging::LogMessage::~LogMessage()
#2 0x00000076a99f ui::InProcessContextFactory::InProcessContextFactory()
#3 0x00000076a44d ui::InitializeContextFactoryForTests()
#4 0x00000073e57a aura::test::AuraTestBase::SetUp()

I'm not sure what the right thing to do here is. Maybe mash_unittests could behave similarly to views_mus_unittests?  But I'm not sure what that would do with existing shelltests in mash/wm. Maybe it needs its own MashTestSuite that blends the behavior of mojo run_all_shelltests.cc and ViewsTestSuite?

 

Comment 1 by sky@chromium.org, Mar 30 2016

I bet it needs code similar to ui/views/run_all_unittests.cc. Specifically the code that initializes gl gfx::GLSurfaceTestSupport::InitializeOneOff() . I suspect it needs more than that though, such as the code to initialize aura::Env and the resource bundle.

Comment 2 by sky@chromium.org, May 23 2016

I suspect I fixed this as part of https://codereview.chromium.org/1994763002 .
It looks like there's some duplicate initialization now. With a test CL that uses ViewsTestBase https://codereview.chromium.org/2009563002 I see this now:

[25116:25116:0524/094443:606921745527:FATAL:context_factories_for_test.cc(25)] Check failed: !g_implicit_factory. ContextFactory for tests already initialized.
#0 0x7ff2f61a4a8e base::debug::StackTrace::StackTrace()
#1 0x7ff2f61fc5cc logging::LogMessage::~LogMessage()
#2 0x00000052f9c5 ui::InitializeContextFactoryForTests()
#3 0x000000a3b17a views::ScopedViewsTestHelper::ScopedViewsTestHelper()
#4 0x000000a3e799 views::ViewsTestBase::SetUp()
#5 0x000000a0d11a _ZN7testing8internal12InvokeHelperIjNSt3tr15tupleIJEEEE12InvokeMethodIN3gfx13GPUTimingFakeEMS8_FjvEEEjPT_T0_RKS4_
#6 0x000000a7245e testing::internal::HandleExceptionsInMethodIfSupported<>()
#7 0x000000a672f3 testing::Test::Run()
#8 0x000000a67a68 testing::TestInfo::Run()
#9 0x000000a6800a testing::TestCase::Run()
#10 0x000000a6d35c testing::internal::UnitTestImpl::RunAllTests()

I think this can wait until someone actually needs to use AuraTestBase or ViewsTestBase -- I just wanted to track the issues I was seeing.

Components: Internals>MUS
Labels: Proj-Mustash

Comment 5 by sky@chromium.org, May 8 2017

It's definitely possible to use AuraTestBase now in mash_unittests (which we do). Not sure on ViewsTestBase though.
Components: -Internals>MUS Internals>Services>WindowService
Components: -MUS
Status: WontFix (was: Untriaged)
mash_unittests has been removed.

Sign in to add a comment