MaterialDesignController::Initialize leaks state between tests run in the same process |
||
Issue descriptionChrome Version : 55.0.2883.11 What steps will reproduce the problem? 1. Remove calls to ui::test::MaterialDesignControllerTestAPI::Uninitialize(); in *::SetUp()* overrides [note: not TearDown()] in views_test_base.cc, browser_test_base.cc, etc. 2. Run tests (e.g. views_unittests) What is the expected result? No flakes What happens instead of that? For example, [45919:1295:1018/134037:102677652065524:FATAL:material_design_controller.cc(47)] Check failed: !is_mode_initialized_. base::debug::StackTrace::StackTrace() + 19 logging::LogMessage::~LogMessage() + 347 ui::MaterialDesignController::Initialize() + 425 views::test::BridgedNativeWidgetTest::SetUp() + 251 testing::Test::Run() + 464 testing::TestInfo::Run() + 1075 testing::TestCase::Run() + 1287 testing::internal::UnitTestImpl::RunAllTests() + 2311 testing::UnitTest::Run() + 413 base::TestSuite::Run() + 486 base::(anonymous namespace)::LaunchUnitTestsInternal(base::Callback<int (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&, int, int, bool, base::Callback<void (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) + 679 base::LaunchUnitTests(int, char**, base::Callback<int (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) + 404 views::ViewsTestSuite::RunTests() + 365 main + 196 start + 52 Added tracing - this was previously initialized in another test run in the same process, with the stack: base::debug::StackTrace::StackTrace() + 19 ui::MaterialDesignController::Initialize() + 367 views::ViewsTestBase::SetUp() + 176 testing::Test::Run() + 464 testing::TestInfo::Run() + 1075 testing::TestCase::Run() + 1287 testing::internal::UnitTestImpl::RunAllTests() + 2311 testing::UnitTest::Run() + 413 base::TestSuite::Run() + 486 base::(anonymous namespace)::LaunchUnitTestsInternal(base::Callback<int (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&, int, int, bool, base::Callback<void (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) + 679 base::LaunchUnitTests(int, char**, base::Callback<int (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) + 404 views::ViewsTestSuite::RunTests() + 365 main + 196 start + 52 views::test::BridgedNativeWidgetTest::SetUp() doesn't call views::ViewsTestBase::SetUp() (because BridgedNativeWidgetTest does not inherit from ViewsTestBase). So some other test initialized MD, but didn't uninitialize it. The test doesn't CHECK() on a retry because the test that used the ViewsTestBase harness isn't run. The problem is in ViewsTestBase -- it doesn't balance the call to Initialize in TearDown(). But neither does ContentTestSuiteBase. The resolution for this began in r387186 which is just to call `ui::test::MaterialDesignControllerTestAPI::Uninitialize();` before any call to `ui::MaterialDesignController::Initialize();` in a test. But that doesn't address the root cause.
,
Oct 18 2016
IsSecondaryUiMaterial is having more use now and will probably need to stay for longer.
,
Oct 23 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by varkha@chromium.org
, Oct 18 2016