OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "mash/test/mash_test_suite.h" | 5 #include "mash/test/mash_test_suite.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "ui/aura/env.h" | 9 #include "ui/aura/env.h" |
10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 void MashTestSuite::Initialize() { | 22 void MashTestSuite::Initialize() { |
23 base::TestSuite::Initialize(); | 23 base::TestSuite::Initialize(); |
24 | 24 |
25 // Load ash mus strings and resources; not 'common' (Chrome) resources. | 25 // Load ash mus strings and resources; not 'common' (Chrome) resources. |
26 base::FilePath resources; | 26 base::FilePath resources; |
27 PathService::Get(base::DIR_MODULE, &resources); | 27 PathService::Get(base::DIR_MODULE, &resources); |
28 resources = resources.Append(FILE_PATH_LITERAL("ash_mus_resources.pak")); | 28 resources = resources.Append(FILE_PATH_LITERAL("ash_mus_resources.pak")); |
29 ui::ResourceBundle::InitSharedInstanceWithPakPath(resources); | 29 ui::ResourceBundle::InitSharedInstanceWithPakPath(resources); |
30 | 30 |
31 base::DiscardableMemoryAllocator::SetInstance(&discardable_memory_allocator_); | 31 base::DiscardableMemoryAllocator::SetInstance(&discardable_memory_allocator_); |
32 env_ = aura::Env::CreateInstance(); | 32 env_ = aura::Env::CreateInstance(aura::Env::Mode::MUS); |
33 gl::GLSurfaceTestSupport::InitializeOneOff(); | 33 gl::GLSurfaceTestSupport::InitializeOneOff(); |
34 const bool enable_pixel_output = false; | 34 const bool enable_pixel_output = false; |
35 env_->set_context_factory( | 35 env_->set_context_factory( |
36 ui::InitializeContextFactoryForTests(enable_pixel_output)); | 36 ui::InitializeContextFactoryForTests(enable_pixel_output)); |
37 } | 37 } |
38 | 38 |
39 void MashTestSuite::Shutdown() { | 39 void MashTestSuite::Shutdown() { |
40 ui::TerminateContextFactoryForTests(); | 40 ui::TerminateContextFactoryForTests(); |
41 env_.reset(); | 41 env_.reset(); |
42 ui::ResourceBundle::CleanupSharedInstance(); | 42 ui::ResourceBundle::CleanupSharedInstance(); |
43 base::TestSuite::Shutdown(); | 43 base::TestSuite::Shutdown(); |
44 } | 44 } |
45 | 45 |
46 } // namespace test | 46 } // namespace test |
47 } // namespace mash | 47 } // namespace mash |
OLD | NEW |