Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / mojo / services / window_manager / window_manager_unittests.cc
blob2ddceb8c83edd25c2ed27c416f9b3d939ba64895
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.
5 #include "base/bind.h"
6 #include "base/test/launcher/unit_test_launcher.h"
7 #include "base/test/test_suite.h"
8 #include "ui/gl/gl_surface.h"
10 #if defined(USE_X11)
11 #include "ui/gfx/x/x11_connection.h"
12 #endif
14 namespace mojo {
16 class WindowManagerTestSuite : public base::TestSuite {
17 public:
18 WindowManagerTestSuite(int argc, char** argv) : TestSuite(argc, argv) {}
19 virtual ~WindowManagerTestSuite() {}
21 protected:
22 virtual void Initialize() OVERRIDE {
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 base::TestSuite::Initialize();
29 gfx::GLSurface::InitializeOneOffForTests();
32 private:
33 DISALLOW_COPY_AND_ASSIGN(WindowManagerTestSuite);
36 } // namespace mojo
38 int main(int argc, char** argv) {
39 mojo::WindowManagerTestSuite test_suite(argc, argv);
41 return base::LaunchUnitTests(
42 argc, argv, base::Bind(&TestSuite::Run, base::Unretained(&test_suite)));