diff options
author | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-23 21:10:47 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-23 21:10:47 +0000 |
commit | 651f906ecbd012c34943ebbeeb03fa7c74e9f730 (patch) | |
tree | 6fe1b3d25e57f3dfb93aabb9bdb3d0e23678c35b /webkit/tools/test_shell | |
parent | 96c9ea12f042a0c12f4de097c86e3be27a458bd2 (diff) | |
download | chromium_src-651f906ecbd012c34943ebbeeb03fa7c74e9f730.zip chromium_src-651f906ecbd012c34943ebbeeb03fa7c74e9f730.tar.gz chromium_src-651f906ecbd012c34943ebbeeb03fa7c74e9f730.tar.bz2 |
Make the Mac TestShell finish launching without crashing by hooking up my
MessagePump
Review URL: http://codereview.chromium.org/4601
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2522 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell')
-rw-r--r-- | webkit/tools/test_shell/mac/main.mm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/webkit/tools/test_shell/mac/main.mm b/webkit/tools/test_shell/mac/main.mm index 030f636..1c36517 100644 --- a/webkit/tools/test_shell/mac/main.mm +++ b/webkit/tools/test_shell/mac/main.mm @@ -14,6 +14,7 @@ #include "base/file_util.h" #include "base/icu_util.h" #include "base/memory_debug.h" +#include "base/message_loop.h" #include "base/path_service.h" #include "base/string_util.h" #include "webkit/glue/webkit_glue.h" @@ -50,6 +51,10 @@ int main(const int argc, const char *argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + // Allocate a message loop for this thread. Although it is not used + // directly, its constructor sets up some necessary state. + MessageLoop main_message_loop(MessageLoop::TYPE_UI); + // Force AppKit to init itself, but don't start the runloop yet [NSApplication sharedApplication]; [NSBundle loadNibNamed:@"MainMenu" owner:NSApp]; @@ -236,9 +241,7 @@ int main(const int argc, const char *argv[]) { TestShell::RunFileTest(WideToUTF8(uri).c_str(), params); } } else { - // we've done our own command line parsing, so tell AppKit that we just - // have the program name. - [NSApp run]; + main_message_loop.Run(); } #ifdef NOTYET |