Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Side by Side Diff: ash/test/ash_test_environment_default.cc

Issue 2316803002: Splits ash_test_resources_100_percent into two pak files (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "ash/test/ash_test_environment.h" 5 #include "ash/test/ash_test_environment.h"
6 6
7 #include "ash/test/ash_test_views_delegate.h" 7 #include "ash/test/ash_test_views_delegate.h"
8 #include "base/files/file_path.h"
8 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
9 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "base/path_service.h"
10 #include "base/run_loop.h" 12 #include "base/run_loop.h"
11 #include "base/test/sequenced_worker_pool_owner.h" 13 #include "base/test/sequenced_worker_pool_owner.h"
12 #include "base/threading/sequenced_worker_pool.h" 14 #include "base/threading/sequenced_worker_pool.h"
15 #include "ui/base/resource/resource_bundle.h"
13 16
14 namespace ash { 17 namespace ash {
15 namespace test { 18 namespace test {
16 namespace { 19 namespace {
17 20
18 class AshTestEnvironmentDefault : public AshTestEnvironment { 21 class AshTestEnvironmentDefault : public AshTestEnvironment {
19 public: 22 public:
20 AshTestEnvironmentDefault() {} 23 AshTestEnvironmentDefault() {}
21 24
22 ~AshTestEnvironmentDefault() override { 25 ~AshTestEnvironmentDefault() override {
(...skipping 23 matching lines...) Expand all
46 DISALLOW_COPY_AND_ASSIGN(AshTestEnvironmentDefault); 49 DISALLOW_COPY_AND_ASSIGN(AshTestEnvironmentDefault);
47 }; 50 };
48 51
49 } // namespace 52 } // namespace
50 53
51 // static 54 // static
52 std::unique_ptr<AshTestEnvironment> AshTestEnvironment::Create() { 55 std::unique_ptr<AshTestEnvironment> AshTestEnvironment::Create() {
53 return base::MakeUnique<AshTestEnvironmentDefault>(); 56 return base::MakeUnique<AshTestEnvironmentDefault>();
54 } 57 }
55 58
59 // static
60 void AshTestEnvironment::AddDataPacks() {
61 base::FilePath path;
62 PathService::Get(base::DIR_MODULE, &path);
63 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
64 if (ui::ResourceBundle::IsScaleFactorSupported(ui::SCALE_FACTOR_100P)) {
65 base::FilePath ash_test_resources_100 =
66 path.Append(FILE_PATH_LITERAL("ash_test_resources_100_percent.pak"));
67 rb.AddDataPackFromPath(ash_test_resources_100, ui::SCALE_FACTOR_100P);
68 }
69 }
70
56 } // namespace test 71 } // namespace test
57 } // namespace ash 72 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698