diff options
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/tools/test_shell/run_all_tests.cc | 11 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_mac.mm | 23 |
2 files changed, 14 insertions, 20 deletions
diff --git a/webkit/tools/test_shell/run_all_tests.cc b/webkit/tools/test_shell/run_all_tests.cc index df6a1ae..5cc12a2 100644 --- a/webkit/tools/test_shell/run_all_tests.cc +++ b/webkit/tools/test_shell/run_all_tests.cc @@ -15,6 +15,10 @@ #include "base/at_exit.h" #include "base/command_line.h" #include "base/icu_util.h" +#if defined(OS_MACOSX) +#include "base/mac_util.h" +#include "base/path_service.h" +#endif #include "base/message_loop.h" #include "base/process_util.h" #include "base/scoped_nsautorelease_pool.h" @@ -42,6 +46,13 @@ int main(int argc, char* argv[]) { // the AtExitManager or else we will leak objects. base::AtExitManager at_exit_manager; +#if defined(OS_MACOSX) + FilePath path; + PathService::Get(base::DIR_EXE, &path); + path = path.AppendASCII("TestShell.app"); + mac_util::SetOverrideAppBundlePath(path); +#endif + TestShellPlatformDelegate::PreflightArgs(&argc, &argv); CommandLine::Init(argc, argv); const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); diff --git a/webkit/tools/test_shell/test_shell_mac.mm b/webkit/tools/test_shell/test_shell_mac.mm index 55cacd9..dea940a 100644 --- a/webkit/tools/test_shell/test_shell_mac.mm +++ b/webkit/tools/test_shell/test_shell_mac.mm @@ -180,26 +180,9 @@ void TestShell::InitializeTestShell(bool layout_test_mode) { // Load the Ahem font, which is used by layout tests. const char* ahem_path_c; - FilePath ahem_path; // Ensure ahem_path_c storage is not freed too soon. - if (mac_util::AmIBundled()) { - // When bundled (in TestShell.app), expect to find the font in - // Contents/Resources. - NSString* ahem_path = [[[NSBundle mainBundle] resourcePath] - stringByAppendingPathComponent:@"AHEM____.TTF"]; - ahem_path_c = [ahem_path fileSystemRepresentation]; - } else { - // When not bundled (in test_shell_tests), look in the source tree for - // the font. - PathService::Get(base::DIR_SOURCE_ROOT, &ahem_path); - ahem_path = ahem_path.Append("webkit"); - ahem_path = ahem_path.Append("tools"); - ahem_path = ahem_path.Append("test_shell"); - ahem_path = ahem_path.Append("resources"); - ahem_path = ahem_path.Append("AHEM____.TTF"); - - ahem_path_c = ahem_path.value().c_str(); - } - + NSString* ahem_path = [[mac_util::MainAppBundle() resourcePath] + stringByAppendingPathComponent:@"AHEM____.TTF"]; + ahem_path_c = [ahem_path fileSystemRepresentation]; FSRef ahem_fsref; if (!mac_util::FSRefFromPath(ahem_path_c, &ahem_fsref)) { DLOG(FATAL) << "FSRefFromPath " << ahem_path_c; |