1// Copyright 2014 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "mojo/services/public/cpp/view_manager/lib/view_manager_test_suite.h"
6
7#include "base/i18n/icu_util.h"
8#include "ui/gl/gl_surface.h"
9
10#if defined(USE_X11)
11#include "ui/gfx/x/x11_connection.h"
12#endif
13
14namespace mojo {
15
16ViewManagerTestSuite::ViewManagerTestSuite(int argc, char** argv)
17    : TestSuite(argc, argv) {}
18
19ViewManagerTestSuite::~ViewManagerTestSuite() {
20}
21
22void ViewManagerTestSuite::Initialize() {
23#if defined(USE_X11)
24  // Each test ends up creating a new thread for the native viewport service.
25  // In other words we'll use X on different threads, so tell it that.
26  gfx::InitializeThreadedX11();
27#endif
28
29#if defined(COMPONENT_BUILD)
30  gfx::GLSurface::InitializeOneOffForTests();
31#endif
32
33  base::TestSuite::Initialize();
34
35  // base::TestSuite and ViewsInit both try to load icu. That's ok for tests.
36  base::i18n::AllowMultipleInitializeCallsForTesting();
37}
38
39}  // namespace mojo
40