summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
Diffstat (limited to 'webkit')
-rw-r--r--webkit/support/platform_support_android.cc6
-rw-r--r--webkit/support/platform_support_linux.cc3
-rw-r--r--webkit/support/platform_support_mac.mm23
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",