diff options
author | morrita@chromium.org <morrita@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-21 07:35:09 +0000 |
---|---|---|
committer | morrita@chromium.org <morrita@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-21 07:35:09 +0000 |
commit | 1ea33a3eb282e4ae9eb1e8bb7dece0336460b6c2 (patch) | |
tree | 88ca1c3ee99c938745445323237bfc12fc3b095a /webkit/support | |
parent | 42581d4ba5ee04c560d59227c13d6cc058420b7e (diff) | |
download | chromium_src-1ea33a3eb282e4ae9eb1e8bb7dece0336460b6c2.zip chromium_src-1ea33a3eb282e4ae9eb1e8bb7dece0336460b6c2.tar.gz chromium_src-1ea33a3eb282e4ae9eb1e8bb7dece0336460b6c2.tar.bz2 |
Added a guard on GetLocalizedString() to make it work with unit tests.
BUG=none
TEST=webkit_unit_tests
Review URL: http://codereview.chromium.org/9813001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127923 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/support')
-rw-r--r-- | webkit/support/platform_support_mac.mm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/webkit/support/platform_support_mac.mm b/webkit/support/platform_support_mac.mm index b1fd6d8..88a32a3 100644 --- a/webkit/support/platform_support_mac.mm +++ b/webkit/support/platform_support_mac.mm @@ -177,6 +177,10 @@ void AfterShutdown() { } // namespace webkit_support string16 TestWebKitPlatformSupport::GetLocalizedString(int message_id) { + // |g_resource_data_pack| is null on unit tests. + // But som unit tests reach GetLocalizedString(). + if (!g_resource_data_pack) + return string16(); base::StringPiece res; if (!g_resource_data_pack->GetStringPiece(message_id, &res)) { LOG(FATAL) << "failed to load webkit string with id " << message_id; |