Commit cb21c4be authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

Have ViewsTestSuite initialize COM.

MaterialDesignController requires COM to be initialized.  Without this, various
views_unittests tests fail when run individually.  (This probably means there's
a second bug somewhere where something is holding COM initialized that shouldn't
be, or the tests would have failed all the time.)

It looks like initializing at the test suite level is roughly where other places
are doing this (e.g. ContentTestSuite), so hopefully this is the right place.

Bug: none
Change-Id: I5e6de4d45c6118b6a2bc69ba960904fa0fd8087d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1531422
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarMichael Wasserman <msw@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#642354}
parent 798b3df4
......@@ -7,13 +7,19 @@
#include "base/test/test_suite.h"
#if defined(USE_AURA)
#include <memory>
#include "build/build_config.h"
#if defined(OS_WIN)
#include "base/win/scoped_com_initializer.h"
#endif
#if defined(USE_AURA) && !defined(OS_CHROMEOS)
#include <memory>
namespace aura {
class Env;
}
#endif
namespace views {
......@@ -42,6 +48,11 @@ class ViewsTestSuite : public base::TestSuite {
// ViewsTestBase.
std::unique_ptr<aura::Env> env_;
#endif
#if defined(OS_WIN)
base::win::ScopedCOMInitializer com_initializer_;
#endif
int argc_;
char** argv_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment