| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "mash/test/mash_test_suite.h" |
| 6 |
| 7 #include "base/files/file_path.h" |
| 8 #include "base/path_service.h" |
| 9 #include "ui/aura/env.h" |
| 10 #include "ui/base/resource/resource_bundle.h" |
| 11 #include "ui/base/ui_base_paths.h" |
| 12 #include "ui/compositor/test/context_factories_for_test.h" |
| 13 #include "ui/gl/test/gl_surface_test_support.h" |
| 14 |
| 15 namespace mash { |
| 16 namespace test { |
| 17 |
| 18 MashTestSuite::MashTestSuite(int argc, char** argv) : TestSuite(argc, argv) {} |
| 19 |
| 20 MashTestSuite::~MashTestSuite() {} |
| 21 |
| 22 void MashTestSuite::Initialize() { |
| 23 base::TestSuite::Initialize(); |
| 24 gfx::GLSurfaceTestSupport::InitializeOneOff(); |
| 25 |
| 26 // Load ash resources and en-US strings; not 'common' (Chrome) resources. |
| 27 // TODO(msw): Check ResourceBundle::IsScaleFactorSupported; load 300% etc. |
| 28 base::FilePath path; |
| 29 PathService::Get(base::DIR_MODULE, &path); |
| 30 base::FilePath mash_test_strings = |
| 31 path.Append(FILE_PATH_LITERAL("mash_wm_resources.pak")); |
| 32 |
| 33 ui::ResourceBundle::InitSharedInstanceWithPakPath(mash_test_strings); |
| 34 |
| 35 base::DiscardableMemoryAllocator::SetInstance(&discardable_memory_allocator_); |
| 36 env_ = aura::Env::CreateInstance(); |
| 37 |
| 38 const bool enable_pixel_output = false; |
| 39 env_->set_context_factory( |
| 40 ui::InitializeContextFactoryForTests(enable_pixel_output)); |
| 41 } |
| 42 |
| 43 void MashTestSuite::Shutdown() { |
| 44 env_.reset(); |
| 45 ui::ResourceBundle::CleanupSharedInstance(); |
| 46 ui::TerminateContextFactoryForTests(); |
| 47 base::TestSuite::Shutdown(); |
| 48 } |
| 49 |
| 50 } // namespace test |
| 51 } // namespace mash |
| OLD | NEW |