| 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 "ui/views/views_test_suite.h" | 5 #include "ui/views/views_test_suite.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #if defined(OS_MACOSX) | 46 #if defined(OS_MACOSX) |
| 47 gpu::ImageTransportSurface::SetAllowOSMesaForTesting(true); | 47 gpu::ImageTransportSurface::SetAllowOSMesaForTesting(true); |
| 48 #endif | 48 #endif |
| 49 | 49 |
| 50 ui::RegisterPathProvider(); | 50 ui::RegisterPathProvider(); |
| 51 | 51 |
| 52 base::FilePath ui_test_pak_path; | 52 base::FilePath ui_test_pak_path; |
| 53 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); | 53 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); |
| 54 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); | 54 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); |
| 55 #if defined(USE_AURA) | 55 #if defined(USE_AURA) |
| 56 env_ = aura::Env::CreateInstance(); | 56 InitializeEnv(); |
| 57 #endif | 57 #endif |
| 58 } | 58 } |
| 59 | 59 |
| 60 void ViewsTestSuite::Shutdown() { | 60 void ViewsTestSuite::Shutdown() { |
| 61 #if defined(USE_AURA) | 61 #if defined(USE_AURA) |
| 62 env_.reset(); | 62 DestroyEnv(); |
| 63 #endif | 63 #endif |
| 64 ui::ResourceBundle::CleanupSharedInstance(); | 64 ui::ResourceBundle::CleanupSharedInstance(); |
| 65 base::TestSuite::Shutdown(); | 65 base::TestSuite::Shutdown(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 #if defined(USE_AURA) |
| 69 void ViewsTestSuite::InitializeEnv() { |
| 70 env_ = aura::Env::CreateInstance(); |
| 71 } |
| 72 |
| 73 void ViewsTestSuite::DestroyEnv() { |
| 74 env_.reset(); |
| 75 } |
| 76 #endif |
| 77 |
| 68 } // namespace views | 78 } // namespace views |
| OLD | NEW |