Commit 0362f600 authored by sky's avatar sky Committed by Commit bot

Makes loading test resources load the first supported scale factor

This is necessary as we don't always load 1x resources. In particular
when I run views_example_exe with --force-device-scale-factor=2 then
1x isn't loaded.

BUG=none
TEST=none
R=oshima@chromium.org

Review URL: https://codereview.chromium.org/564473002

Cr-Commit-Position: refs/heads/master@{#294196}
parent c51cb78e
...@@ -321,8 +321,10 @@ std::string ResourceBundle::LoadLocaleResources( ...@@ -321,8 +321,10 @@ std::string ResourceBundle::LoadLocaleResources(
void ResourceBundle::LoadTestResources(const base::FilePath& path, void ResourceBundle::LoadTestResources(const base::FilePath& path,
const base::FilePath& locale_path) { const base::FilePath& locale_path) {
DCHECK(!ui::GetSupportedScaleFactors().empty());
const ScaleFactor scale_factor(ui::GetSupportedScaleFactors()[0]);
// Use the given resource pak for both common and localized resources. // Use the given resource pak for both common and localized resources.
scoped_ptr<DataPack> data_pack(new DataPack(SCALE_FACTOR_100P)); scoped_ptr<DataPack> data_pack(new DataPack(scale_factor));
if (!path.empty() && data_pack->LoadFromPath(path)) if (!path.empty() && data_pack->LoadFromPath(path))
AddDataPack(data_pack.release()); AddDataPack(data_pack.release());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment