| 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 "ui/aura/env.h" | 9 #include "ui/aura/env.h" |
| 10 #include "ui/gl/gl_surface.h" | 10 #include "ui/gl/gl_surface.h" |
| 11 #include "ui/gl/test/gl_surface_test_support.h" | 11 #include "ui/gl/test/gl_surface_test_support.h" |
| 12 | 12 |
| 13 class AuraTestSuite : public base::TestSuite { | 13 class AuraTestSuite : public base::TestSuite { |
| 14 public: | 14 public: |
| 15 AuraTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} | 15 AuraTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} |
| 16 | 16 |
| 17 protected: | 17 protected: |
| 18 void Initialize() override { | 18 void Initialize() override { |
| 19 base::TestSuite::Initialize(); | 19 base::TestSuite::Initialize(); |
| 20 gfx::GLSurfaceTestSupport::InitializeOneOff(); | 20 gl::GLSurfaceTestSupport::InitializeOneOff(); |
| 21 env_ = aura::Env::CreateInstance(); | 21 env_ = aura::Env::CreateInstance(); |
| 22 } | 22 } |
| 23 | 23 |
| 24 void Shutdown() override { | 24 void Shutdown() override { |
| 25 env_.reset(); | 25 env_.reset(); |
| 26 base::TestSuite::Shutdown(); | 26 base::TestSuite::Shutdown(); |
| 27 } | 27 } |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 std::unique_ptr<aura::Env> env_; | 30 std::unique_ptr<aura::Env> env_; |
| 31 DISALLOW_COPY_AND_ASSIGN(AuraTestSuite); | 31 DISALLOW_COPY_AND_ASSIGN(AuraTestSuite); |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 int main(int argc, char** argv) { | 34 int main(int argc, char** argv) { |
| 35 AuraTestSuite test_suite(argc, argv); | 35 AuraTestSuite test_suite(argc, argv); |
| 36 | 36 |
| 37 return base::LaunchUnitTests( | 37 return base::LaunchUnitTests( |
| 38 argc, | 38 argc, |
| 39 argv, | 39 argv, |
| 40 base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite))); | 40 base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite))); |
| 41 } | 41 } |
| OLD | NEW |