diff options
author | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-11 15:37:54 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-11 15:37:54 +0000 |
commit | b0ab4e659276d42dd13898c6fe51a019b0e62d67 (patch) | |
tree | fb7770614c7c05eb65b6e89f661c368da15d2e75 /webkit/tools/test_shell | |
parent | c6674ccbf3850cd1fc20c21307bbfa3fa0fb72c2 (diff) | |
download | chromium_src-b0ab4e659276d42dd13898c6fe51a019b0e62d67.zip chromium_src-b0ab4e659276d42dd13898c6fe51a019b0e62d67.tar.gz chromium_src-b0ab4e659276d42dd13898c6fe51a019b0e62d67.tar.bz2 |
Allow Mac test_shell_tests to run without crashing. Not all tests pass yet,
though.
Review URL: http://codereview.chromium.org/13734
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6791 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell')
-rw-r--r-- | webkit/tools/test_shell/run_all_tests.cc | 8 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_mac.mm | 11 |
2 files changed, 15 insertions, 4 deletions
diff --git a/webkit/tools/test_shell/run_all_tests.cc b/webkit/tools/test_shell/run_all_tests.cc index dec7010..d7ff3d0 100644 --- a/webkit/tools/test_shell/run_all_tests.cc +++ b/webkit/tools/test_shell/run_all_tests.cc @@ -26,6 +26,10 @@ #include "webkit/tools/test_shell/test_shell_test.h" #include "testing/gtest/include/gtest/gtest.h" +#if defined(OS_MACOSX) +#include "WebSystemInterface.h" +#endif + const char* TestShellTest::kJavascriptDelayExitScript = "<script>" "window.layoutTestController.waitUntilDone();" @@ -36,6 +40,10 @@ const char* TestShellTest::kJavascriptDelayExitScript = "</script>"; int main(int argc, char* argv[]) { +#if defined(OS_MACOSX) + InitWebCoreSystemInterface(); +#endif + base::ScopedNSAutoreleasePool autorelease_pool; base::EnableTerminationOnHeapCorruption(); // Some unittests may use base::Singleton<>, thus we need to instanciate diff --git a/webkit/tools/test_shell/test_shell_mac.mm b/webkit/tools/test_shell/test_shell_mac.mm index fd2bd99..403f1f0 100644 --- a/webkit/tools/test_shell/test_shell_mac.mm +++ b/webkit/tools/test_shell/test_shell_mac.mm @@ -93,8 +93,7 @@ base::LazyInstance <std::map<gfx::WindowHandle, TestShell *> > // does the work of removing the window from our various bookkeeping lists // and gets rid of the shell. - (void)cleanup:(id)window { - BOOL found = TestShell::RemoveWindowFromList(window); - DCHECK(found); + TestShell::RemoveWindowFromList(window); TestShell::DestroyAssociatedShell(window); [self release]; @@ -130,6 +129,10 @@ void TestShell::PlatformShutdown() { // static void TestShell::InitializeTestShell(bool layout_test_mode) { + // This should move to a per-process platform-specific initialization function + // when one exists. + [NSApplication sharedApplication]; + window_list_ = new WindowList; layout_test_mode_ = layout_test_mode; @@ -405,8 +408,8 @@ bool TestShell::CreateNewWindow(const std::wstring& startingURL, // static void TestShell::DestroyWindow(gfx::WindowHandle windowHandle) { - // Do we want to tear down some of the machinery behind the scenes too? - [windowHandle performClose:nil]; + TestShell::RemoveWindowFromList(windowHandle); + [windowHandle close]; } WebWidget* TestShell::CreatePopupWidget(WebView* webview) { |