Chromium Code Reviews| 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 14 matching lines...) Expand all Loading... | |
| 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(aura::Env::Mode::MUS); | 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 |
| 36 ui::InitializeContextFactoryForTests(enable_pixel_output)); | 36 ui::ContextFactory* context_factory = nullptr; |
| 37 ui::ContextFactoryPrivate* context_factory_private = nullptr; | |
| 38 ui::InitializeContextFactoryForTests(enable_pixel_output, &context_factory, | |
| 39 &context_factory_private); | |
| 40 | |
| 41 env_->set_context_factory(context_factory); | |
| 42 env_->set_context_factory_private(context_factory_private); | |
|
rjkroege
2016/12/14 00:15:31
Why is this necessary? This is mash code. It's a c
Fady Samuel
2016/12/14 01:27:12
I don't think it's necessary. Removed.
Fady Samuel
2016/12/14 04:51:02
I don't understand what's going on...
It seems li
| |
| 37 } | 43 } |
| 38 | 44 |
| 39 void MashTestSuite::Shutdown() { | 45 void MashTestSuite::Shutdown() { |
| 40 ui::TerminateContextFactoryForTests(); | 46 ui::TerminateContextFactoryForTests(); |
| 41 env_.reset(); | 47 env_.reset(); |
| 42 ui::ResourceBundle::CleanupSharedInstance(); | 48 ui::ResourceBundle::CleanupSharedInstance(); |
| 43 base::TestSuite::Shutdown(); | 49 base::TestSuite::Shutdown(); |
| 44 } | 50 } |
| 45 | 51 |
| 46 } // namespace test | 52 } // namespace test |
| 47 } // namespace mash | 53 } // namespace mash |
| OLD | NEW |