| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/test/launcher/unit_test_launcher.h" | 9 #include "base/test/launcher/unit_test_launcher.h" |
| 10 #include "base/test/test_suite.h" | 10 #include "base/test/test_suite.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 protected: | 24 protected: |
| 25 void Initialize() override { | 25 void Initialize() override { |
| 26 base::TestSuite::Initialize(); | 26 base::TestSuite::Initialize(); |
| 27 gfx::GLSurfaceTestSupport::InitializeOneOff(); | 27 gfx::GLSurfaceTestSupport::InitializeOneOff(); |
| 28 ui::RegisterPathProvider(); | 28 ui::RegisterPathProvider(); |
| 29 | 29 |
| 30 base::FilePath ui_test_pak_path; | 30 base::FilePath ui_test_pak_path; |
| 31 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); | 31 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); |
| 32 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); | 32 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); |
| 33 #if defined(USE_AURA) | 33 #if defined(USE_AURA) |
| 34 env_ = aura::Env::CreateInstance(); | 34 aura::Env::CreateInstance(true); |
| 35 #endif | 35 #endif |
| 36 } | 36 } |
| 37 | 37 |
| 38 void Shutdown() override { | 38 void Shutdown() override { |
| 39 #if defined(USE_AURA) | 39 #if defined(USE_AURA) |
| 40 env_.reset(); | 40 aura::Env::DeleteInstance(); |
| 41 #endif | 41 #endif |
| 42 ui::ResourceBundle::CleanupSharedInstance(); | 42 ui::ResourceBundle::CleanupSharedInstance(); |
| 43 base::TestSuite::Shutdown(); | 43 base::TestSuite::Shutdown(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 #if defined(USE_AURA) | |
| 48 scoped_ptr<aura::Env> env_; | |
| 49 #endif | |
| 50 DISALLOW_COPY_AND_ASSIGN(ViewTestSuite); | 47 DISALLOW_COPY_AND_ASSIGN(ViewTestSuite); |
| 51 }; | 48 }; |
| 52 | 49 |
| 53 int main(int argc, char** argv) { | 50 int main(int argc, char** argv) { |
| 54 ViewTestSuite test_suite(argc, argv); | 51 ViewTestSuite test_suite(argc, argv); |
| 55 | 52 |
| 56 return base::LaunchUnitTests( | 53 return base::LaunchUnitTests( |
| 57 argc, argv, base::Bind(&ViewTestSuite::Run, | 54 argc, argv, base::Bind(&ViewTestSuite::Run, |
| 58 base::Unretained(&test_suite))); | 55 base::Unretained(&test_suite))); |
| 59 } | 56 } |
| OLD | NEW |