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

Unified Diff: ui/base/resource/resource_bundle_unittest.cc

Issue 537063002: Eliminate silently letting errors pass on pak loading. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: one last time Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
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 488947dbc8f8be5bb1067e830662b3c5b900d624..11a886654155f7045ea9e6bc37169d4a3380b76a 100644
--- a/ui/base/resource/resource_bundle_unittest.cc
+++ b/ui/base/resource/resource_bundle_unittest.cc
@@ -186,7 +186,7 @@ TEST_F(ResourceBundleTest, DelegateGetPathForResourcePack) {
Property(&base::FilePath::value, pack_path.value()),
pack_scale_factor))
.Times(1)
- .WillOnce(Return(pack_path));
+ .WillOnce(Return(base::FilePath()));
resource_bundle->AddDataPackFromPath(pack_path, pack_scale_factor);
}
@@ -414,7 +414,6 @@ class ResourceBundleImageTest : public ResourceBundleTest {
};
// 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"));
@@ -429,13 +428,6 @@ TEST_F(ResourceBundleImageTest, LoadDataResourceBytes) {
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));
}
TEST_F(ResourceBundleImageTest, GetRawDataResource) {

Powered by Google App Engine
This is Rietveld 408576698