diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-08 09:53:47 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-08 09:53:47 +0000 |
commit | 72332cefe953ed95d67d67203273a20f72954e3c (patch) | |
tree | 7776b1b73a649ab160adaf623df28858565b9ebc /webkit | |
parent | db0c3185d6a1549e4cb82277048011dc97b8f9d5 (diff) | |
download | chromium_src-72332cefe953ed95d67d67203273a20f72954e3c.zip chromium_src-72332cefe953ed95d67d67203273a20f72954e3c.tar.gz chromium_src-72332cefe953ed95d67d67203273a20f72954e3c.tar.bz2 |
Load DumpRenderTree.pak also for webkit unit tests
See e.g. https://bugs.webkit.org/show_bug.cgi?id=78746#c29
BUG=none
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10855024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150530 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/support/platform_support_android.cc | 6 | ||||
-rw-r--r-- | webkit/support/platform_support_linux.cc | 3 | ||||
-rw-r--r-- | webkit/support/platform_support_mac.mm | 23 |
3 files changed, 19 insertions, 13 deletions
diff --git a/webkit/support/platform_support_android.cc b/webkit/support/platform_support_android.cc index 4183312..52a33a1 100644 --- a/webkit/support/platform_support_android.cc +++ b/webkit/support/platform_support_android.cc @@ -51,13 +51,13 @@ void BeforeInitialize(bool unit_test_mode) { } void AfterInitialize(bool unit_test_mode) { - if (unit_test_mode) - return; // We don't have a resource pack when running the unit-tests. - FilePath data_path(kDumpRenderTreeDir); data_path = data_path.Append("DumpRenderTree.pak"); ResourceBundle::InitSharedInstanceWithPakPath(data_path); + if (unit_test_mode) + return; + // We enable file-over-http to bridge the file protocol to http protocol // in here, which can // (1) run the layout tests on android target device, but never need to diff --git a/webkit/support/platform_support_linux.cc b/webkit/support/platform_support_linux.cc index 7734b11..0ee9310 100644 --- a/webkit/support/platform_support_linux.cc +++ b/webkit/support/platform_support_linux.cc @@ -23,9 +23,6 @@ void BeforeInitialize(bool unit_test_mode) { } void AfterInitialize(bool unit_test_mode) { - if (unit_test_mode) - return; // We don't have a resource pack when running the unit-tests. - FilePath data_path; PathService::Get(base::DIR_EXE, &data_path); data_path = data_path.Append("DumpRenderTree.pak"); diff --git a/webkit/support/platform_support_mac.mm b/webkit/support/platform_support_mac.mm index 5d1d891..2d43c3e 100644 --- a/webkit/support/platform_support_mac.mm +++ b/webkit/support/platform_support_mac.mm @@ -99,19 +99,28 @@ static void SwizzleNSPasteboard() { } void AfterInitialize(bool unit_test_mode) { - if (unit_test_mode) - return; // We don't have a resource pack when running the unit-tests. - // Load a data pack. g_resource_data_pack = new ui::DataPack(ui::SCALE_FACTOR_100P); - NSString* resource_path = - [base::mac::FrameworkBundle() pathForResource:@"DumpRenderTree" - ofType:@"pak"]; - FilePath resources_pak_path([resource_path fileSystemRepresentation]); + FilePath resources_pak_path; + if (unit_test_mode) { + PathService::Get(base::DIR_EXE, &resources_pak_path); + resources_pak_path = resources_pak_path.Append("DumpRenderTree.app") + .Append("Contents") + .Append("Resources") + .Append("DumpRenderTree.pak"); + } else { + NSString* resource_path = + [base::mac::FrameworkBundle() pathForResource:@"DumpRenderTree" + ofType:@"pak"]; + resources_pak_path = FilePath([resource_path fileSystemRepresentation]); + } if (!g_resource_data_pack->LoadFromPath(resources_pak_path)) { LOG(FATAL) << "failed to load DumpRenderTree.pak"; } + if (unit_test_mode) + return; + // Load font files in the resource folder. static const char* const fontFileNames[] = { "AHEM____.TTF", |