Description[Mac] Return an empty StringPiece from GetDataResource() when |g_resource_data_pack| is NULL.
When running unit tests, |g_resource_data_pack| is never loaded. As a result,
if a resource is needed by code exercised by a test, the dereference of
|g_resource_data_pack| would previously crash, unless that resource id was
special cased.
This CL changes it to instead return an empty StringPiece, rather than
crashing. This allows PlatformBridge::loadPlatformImageResource() to
return a Image::nullImage() in this case, which is fine for some resources
loaded during unit tests.
In particular, this fixes a crash in webkit_unit_tests that would otherwise
happen with: https://bugs.webkit.org/show_bug.cgi?id=66707.
BUG=93397
TEST=Run webkit_unit_tests with patch from https://bugs.webkit.org/show_bug.cgi?id=66707. They shouldn't crash.
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=98101
Patch Set 1 #
Messages
Total messages: 6 (0 generated)
|