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

Unified Diff: webkit/support/platform_support_mac.mm

Issue 10855024: Load DumpRenderTree.pak also for webkit unit tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 8 years, 4 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
« no previous file with comments | « webkit/support/platform_support_linux.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/support/platform_support_mac.mm
diff --git a/webkit/support/platform_support_mac.mm b/webkit/support/platform_support_mac.mm
index 5d1d89170a7b923e339c05148f137a4c3bc7bbff..2d43c3e13927478c368def443f5c33bbca55b69f 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",
« no previous file with comments | « webkit/support/platform_support_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698