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