| Index: ui/base/resource/resource_bundle_unittest.cc
|
| diff --git a/ui/base/resource/resource_bundle_unittest.cc b/ui/base/resource/resource_bundle_unittest.cc
|
| index 11a886654155f7045ea9e6bc37169d4a3380b76a..488947dbc8f8be5bb1067e830662b3c5b900d624 100644
|
| --- a/ui/base/resource/resource_bundle_unittest.cc
|
| +++ b/ui/base/resource/resource_bundle_unittest.cc
|
| @@ -186,7 +186,7 @@
|
| Property(&base::FilePath::value, pack_path.value()),
|
| pack_scale_factor))
|
| .Times(1)
|
| - .WillOnce(Return(base::FilePath()));
|
| + .WillOnce(Return(pack_path));
|
|
|
| resource_bundle->AddDataPackFromPath(pack_path, pack_scale_factor);
|
| }
|
| @@ -414,6 +414,7 @@
|
| };
|
|
|
| // Verify that we don't crash when trying to load a resource that is not found.
|
| +// In some cases, we fail to mmap resources.pak, but try to keep going anyway.
|
| TEST_F(ResourceBundleImageTest, LoadDataResourceBytes) {
|
| base::FilePath data_path = dir_path().Append(FILE_PATH_LITERAL("sample.pak"));
|
|
|
| @@ -426,6 +427,13 @@
|
| resource_bundle->AddDataPackFromPath(data_path, SCALE_FACTOR_100P);
|
|
|
| const int kUnfoundResourceId = 10000;
|
| + EXPECT_EQ(NULL, resource_bundle->LoadDataResourceBytes(
|
| + kUnfoundResourceId));
|
| +
|
| + // Give a .pak file that doesn't exist so we will fail to load it.
|
| + resource_bundle->AddDataPackFromPath(
|
| + base::FilePath(FILE_PATH_LITERAL("non-existant-file.pak")),
|
| + ui::SCALE_FACTOR_NONE);
|
| EXPECT_EQ(NULL, resource_bundle->LoadDataResourceBytes(
|
| kUnfoundResourceId));
|
| }
|
|
|