diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-14 01:01:31 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-14 01:01:31 +0000 |
commit | 7912282690d4ec3a0a408af669febb4db0930119 (patch) | |
tree | ba6d86bb2fcffd0c0cb6b92d7a8c19b14bce5e15 | |
parent | 0e3e3e3315a4233ba97c401a59bfd0bc452f46c5 (diff) | |
download | chromium_src-7912282690d4ec3a0a408af669febb4db0930119.zip chromium_src-7912282690d4ec3a0a408af669febb4db0930119.tar.gz chromium_src-7912282690d4ec3a0a408af669febb4db0930119.tar.bz2 |
test_shell: flush message loop before destroying the shell.
Valgrind pointed out that we need extra events like focus-out to be processed
before we delete the object.
(While I'm at it, remove a useless if statement.)
BUG=9500
Review URL: http://codereview.chromium.org/113382
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16024 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/tools/test_shell/test_shell_main.cc | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/webkit/tools/test_shell/test_shell_main.cc b/webkit/tools/test_shell/test_shell_main.cc index 6dc5c2b..166fcae 100644 --- a/webkit/tools/test_shell/test_shell_main.cc +++ b/webkit/tools/test_shell/test_shell_main.cc @@ -301,13 +301,17 @@ int main(int argc, char* argv[]) { shell->CallJSGC(); shell->CallJSGC(); - if (shell) { - // When we finish the last test, cleanup the LayoutTestController. - // It may have references to not-yet-cleaned up windows. By - // cleaning up here we help purify reports. - shell->ResetTestController(); - delete shell; - } + + // When we finish the last test, cleanup the LayoutTestController. + // It may have references to not-yet-cleaned up windows. By + // cleaning up here we help purify reports. + shell->ResetTestController(); + + // Flush any remaining messages before we kill ourselves. + // http://code.google.com/p/chromium/issues/detail?id=9500 + MessageLoop::current()->RunAllPending(); + + delete shell; } else { MessageLoop::current()->Run(); } |