Chromium Code Reviews| 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 "ash/test/ash_test_suite.h" | 5 #include "ash/test/ash_test_suite.h" |
| 6 | 6 |
| 7 #include "ash/public/cpp/config.h" | 7 #include "ash/public/cpp/config.h" |
| 8 #include "ash/test/ash_test_environment.h" | 8 #include "ash/test/ash_test_environment.h" |
| 9 #include "ash/test/ash_test_helper.h" | 9 #include "ash/test/ash_test_helper.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 54 ash_test_resources_100, ui::SCALE_FACTOR_100P); | 54 ash_test_resources_100, ui::SCALE_FACTOR_100P); |
| 55 } | 55 } |
| 56 if (ui::ResourceBundle::IsScaleFactorSupported(ui::SCALE_FACTOR_200P)) { | 56 if (ui::ResourceBundle::IsScaleFactorSupported(ui::SCALE_FACTOR_200P)) { |
| 57 base::FilePath ash_test_resources_200 = | 57 base::FilePath ash_test_resources_200 = |
| 58 path.Append(FILE_PATH_LITERAL("ash_test_resources_200_percent.pak")); | 58 path.Append(FILE_PATH_LITERAL("ash_test_resources_200_percent.pak")); |
| 59 ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath( | 59 ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath( |
| 60 ash_test_resources_200, ui::SCALE_FACTOR_200P); | 60 ash_test_resources_200, ui::SCALE_FACTOR_200P); |
| 61 } | 61 } |
| 62 | 62 |
| 63 const bool is_mus = base::CommandLine::ForCurrentProcess()->HasSwitch("mus"); | 63 const bool is_mus = base::CommandLine::ForCurrentProcess()->HasSwitch("mus"); |
| 64 ash::test::AshTestHelper::config_ = is_mus ? Config::MUS : Config::CLASSIC; | 64 const bool is_mash = |
| 65 base::CommandLine::ForCurrentProcess()->HasSwitch("mash"); | |
| 66 ash::test::AshTestHelper::config_ = | |
| 67 is_mus ? Config::MUS : is_mash ? Config::MASH : Config::CLASSIC; | |
| 65 | 68 |
| 66 base::DiscardableMemoryAllocator::SetInstance(&discardable_memory_allocator_); | 69 base::DiscardableMemoryAllocator::SetInstance(&discardable_memory_allocator_); |
| 67 env_ = aura::Env::CreateInstance(is_mus ? aura::Env::Mode::MUS | 70 env_ = aura::Env::CreateInstance(is_mus | is_mash ? aura::Env::Mode::MUS |
|
sky
2017/05/30 17:34:31
| -> ||
jonross
2017/05/30 17:58:40
Done.
| |
| 68 : aura::Env::Mode::LOCAL); | 71 : aura::Env::Mode::LOCAL); |
| 69 | 72 |
| 70 if (is_mus) { | 73 if (is_mus || is_mash) { |
| 71 context_factory_ = base::MakeUnique<ui::FakeContextFactory>(); | 74 context_factory_ = base::MakeUnique<ui::FakeContextFactory>(); |
| 72 env_->set_context_factory(context_factory_.get()); | 75 env_->set_context_factory(context_factory_.get()); |
| 73 env_->set_context_factory_private(nullptr); | 76 env_->set_context_factory_private(nullptr); |
| 74 } | 77 } |
| 75 } | 78 } |
| 76 | 79 |
| 77 void AshTestSuite::Shutdown() { | 80 void AshTestSuite::Shutdown() { |
| 78 env_.reset(); | 81 env_.reset(); |
| 79 ui::ResourceBundle::CleanupSharedInstance(); | 82 ui::ResourceBundle::CleanupSharedInstance(); |
| 80 base::TestSuite::Shutdown(); | 83 base::TestSuite::Shutdown(); |
| 81 } | 84 } |
| 82 | 85 |
| 83 } // namespace test | 86 } // namespace test |
| 84 } // namespace ash | 87 } // namespace ash |
| OLD | NEW |