Pack unscaled resources separately in tests
Bug: 1264038
Change-Id: I788fef77cc5edf07d87b5ef4b87e8a3c5a57335b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3309167
Commit-Queue: Mitsuru Oshima <[email protected]>
Commit-Queue: Avery Musbach <[email protected]>
Auto-Submit: Mitsuru Oshima <[email protected]>
Reviewed-by: Avery Musbach <[email protected]>
Cr-Commit-Position: refs/heads/main@{#947633}
diff --git a/ash/test/ash_test_suite.cc b/ash/test/ash_test_suite.cc
index 91da094..7ee8890 100644
--- a/ash/test/ash_test_suite.cc
+++ b/ash/test/ash_test_suite.cc
@@ -44,6 +44,13 @@
ui::ResourceBundle::SetParseLottieAsStillImage(
&lottie::ParseLottieAsStillImage);
+ LoadTestResources();
+
+ base::DiscardableMemoryAllocator::SetInstance(&discardable_memory_allocator_);
+ env_ = aura::Env::CreateInstance();
+}
+
+void AshTestSuite::LoadTestResources() {
// Load ash test resources and en-US strings; not 'common' (Chrome) resources.
base::FilePath path;
base::PathService::Get(base::DIR_ASSETS, &path);
@@ -51,6 +58,10 @@
path.Append(FILE_PATH_LITERAL("ash_test_strings.pak"));
ui::ResourceBundle::InitSharedInstanceWithPakPath(ash_test_strings);
+ ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath(
+ path.AppendASCII("ash_test_resources_unscaled.pak"),
+ ui::kScaleFactorNone);
+
if (ui::ResourceBundle::IsScaleFactorSupported(ui::k100Percent)) {
base::FilePath ash_test_resources_100 =
path.AppendASCII("ash_test_resources_100_percent.pak");
@@ -63,9 +74,6 @@
ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath(
ash_test_resources_200, ui::k200Percent);
}
-
- base::DiscardableMemoryAllocator::SetInstance(&discardable_memory_allocator_);
- env_ = aura::Env::CreateInstance();
}
void AshTestSuite::Shutdown() {