| 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 MashTestSuite::MashTestSuite(int argc, char** argv) : TestSuite(argc, argv) {} | 58 MashTestSuite::MashTestSuite(int argc, char** argv) : TestSuite(argc, argv) {} |
| 59 | 59 |
| 60 MashTestSuite::~MashTestSuite() {} | 60 MashTestSuite::~MashTestSuite() {} |
| 61 | 61 |
| 62 void MashTestSuite::Initialize() { | 62 void MashTestSuite::Initialize() { |
| 63 base::TestSuite::Initialize(); | 63 base::TestSuite::Initialize(); |
| 64 | 64 |
| 65 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 65 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 66 switches::kOverrideUseGLWithOSMesaForTests); | 66 switches::kOverrideUseSoftwareGLForTests); |
| 67 | 67 |
| 68 // Load ash mus strings and resources; not 'common' (Chrome) resources. | 68 // Load ash mus strings and resources; not 'common' (Chrome) resources. |
| 69 base::FilePath resources; | 69 base::FilePath resources; |
| 70 PathService::Get(base::DIR_MODULE, &resources); | 70 PathService::Get(base::DIR_MODULE, &resources); |
| 71 resources = resources.Append(FILE_PATH_LITERAL("ash_mus_resources.pak")); | 71 resources = resources.Append(FILE_PATH_LITERAL("ash_mus_resources.pak")); |
| 72 ui::ResourceBundle::InitSharedInstanceWithPakPath(resources); | 72 ui::ResourceBundle::InitSharedInstanceWithPakPath(resources); |
| 73 | 73 |
| 74 base::DiscardableMemoryAllocator::SetInstance(&discardable_memory_allocator_); | 74 base::DiscardableMemoryAllocator::SetInstance(&discardable_memory_allocator_); |
| 75 env_ = aura::Env::CreateInstance(aura::Env::Mode::MUS); | 75 env_ = aura::Env::CreateInstance(aura::Env::Mode::MUS); |
| 76 | 76 |
| 77 compositor_context_factory_ = base::MakeUnique<TestContextFactory>(); | 77 compositor_context_factory_ = base::MakeUnique<TestContextFactory>(); |
| 78 env_->set_context_factory(compositor_context_factory_.get()); | 78 env_->set_context_factory(compositor_context_factory_.get()); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void MashTestSuite::Shutdown() { | 81 void MashTestSuite::Shutdown() { |
| 82 env_.reset(); | 82 env_.reset(); |
| 83 ui::ResourceBundle::CleanupSharedInstance(); | 83 ui::ResourceBundle::CleanupSharedInstance(); |
| 84 base::TestSuite::Shutdown(); | 84 base::TestSuite::Shutdown(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 } // namespace test | 87 } // namespace test |
| 88 } // namespace mash | 88 } // namespace mash |
| OLD | NEW |