OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/macros.h" | 6 #include "base/macros.h" |
7 #include "base/test/launcher/unit_test_launcher.h" | 7 #include "base/test/launcher/unit_test_launcher.h" |
8 #include "base/test/test_suite.h" | 8 #include "base/test/test_suite.h" |
| 9 #include "mojo/edk/embedder/embedder.h" |
9 #include "ui/aura/env.h" | 10 #include "ui/aura/env.h" |
10 #include "ui/gl/gl_surface.h" | 11 #include "ui/gl/gl_surface.h" |
11 #include "ui/gl/test/gl_surface_test_support.h" | 12 #include "ui/gl/test/gl_surface_test_support.h" |
12 | 13 |
13 class AuraTestSuite : public base::TestSuite { | 14 class AuraTestSuite : public base::TestSuite { |
14 public: | 15 public: |
15 AuraTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} | 16 AuraTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} |
16 | 17 |
17 protected: | 18 protected: |
18 void Initialize() override { | 19 void Initialize() override { |
19 base::TestSuite::Initialize(); | 20 base::TestSuite::Initialize(); |
20 gl::GLSurfaceTestSupport::InitializeOneOff(); | 21 gl::GLSurfaceTestSupport::InitializeOneOff(); |
21 env_ = aura::Env::CreateInstance(); | 22 env_ = aura::Env::CreateInstance(); |
22 } | 23 } |
23 | 24 |
24 void Shutdown() override { | 25 void Shutdown() override { |
25 env_.reset(); | 26 env_.reset(); |
26 base::TestSuite::Shutdown(); | 27 base::TestSuite::Shutdown(); |
27 } | 28 } |
28 | 29 |
29 private: | 30 private: |
30 std::unique_ptr<aura::Env> env_; | 31 std::unique_ptr<aura::Env> env_; |
31 DISALLOW_COPY_AND_ASSIGN(AuraTestSuite); | 32 DISALLOW_COPY_AND_ASSIGN(AuraTestSuite); |
32 }; | 33 }; |
33 | 34 |
34 int main(int argc, char** argv) { | 35 int main(int argc, char** argv) { |
35 AuraTestSuite test_suite(argc, argv); | 36 AuraTestSuite test_suite(argc, argv); |
36 | 37 |
| 38 mojo::edk::Init(); |
37 return base::LaunchUnitTests( | 39 return base::LaunchUnitTests( |
38 argc, | 40 argc, |
39 argv, | 41 argv, |
40 base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite))); | 42 base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite))); |
41 } | 43 } |
OLD | NEW |