diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-06 21:43:07 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-06 21:43:07 +0000 |
commit | 052f1b55d5bcf349a158af65876285d200d92184 (patch) | |
tree | 08ae4ac84c9de04069450dbd4cfc427973182677 /webkit/tools | |
parent | ea6e6cf0f3aa1e0ec2ea9ddbbebbb272e9bbc019 (diff) | |
download | chromium_src-052f1b55d5bcf349a158af65876285d200d92184.zip chromium_src-052f1b55d5bcf349a158af65876285d200d92184.tar.gz chromium_src-052f1b55d5bcf349a158af65876285d200d92184.tar.bz2 |
Enabled WebFrameTest, refactored some test shell functions.
Review URL: http://codereview.chromium.org/9652
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4916 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools')
-rw-r--r-- | webkit/tools/test_shell/SConscript | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/run_all_tests.cc | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.cc | 21 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_win.cc | 8 |
4 files changed, 17 insertions, 18 deletions
diff --git a/webkit/tools/test_shell/SConscript b/webkit/tools/test_shell/SConscript index 3b608552..d90de13 100644 --- a/webkit/tools/test_shell/SConscript +++ b/webkit/tools/test_shell/SConscript @@ -168,6 +168,7 @@ test_files = [ '$WEBKIT_DIR/glue/multipart_response_delegate_unittest.cc', '$WEBKIT_DIR/glue/password_autocomplete_listener_unittest.cc', '$WEBKIT_DIR/glue/regular_expression_unittest.cc', + '$WEBKIT_DIR/glue/webframe_unittest.cc', '$WEBKIT_DIR/port/platform/GKURL_unittest.cpp', '$V8_DIR/snapshot-empty$OBJSUFFIX', ] @@ -184,7 +185,6 @@ if env['PLATFORM'] == 'win32': '$WEBKIT_DIR/glue/resource_fetcher_unittest.cc', # Commented out until a regression is fixed and this file is restored. #'$WEBKIT_DIR/glue/stringimpl_unittest.cc', - '$WEBKIT_DIR/glue/webframe_unittest.cc', '$WEBKIT_DIR/glue/webplugin_impl_unittest.cc', '$WEBKIT_DIR/port/platform/image-decoders/bmp/BMPImageDecoder_unittest.cpp', '$WEBKIT_DIR/port/platform/image-decoders/ico/ICOImageDecoder_unittest.cpp', diff --git a/webkit/tools/test_shell/run_all_tests.cc b/webkit/tools/test_shell/run_all_tests.cc index 60de050..9a7f55b 100644 --- a/webkit/tools/test_shell/run_all_tests.cc +++ b/webkit/tools/test_shell/run_all_tests.cc @@ -47,9 +47,9 @@ int main(int argc, char* argv[]) { CommandLine::SetArgcArgv(argc, argv); #endif -#if defined(OS_WIN) TestShell::InitLogging(true, false); // suppress error dialogs +#if defined(OS_WIN) // Some of the individual tests wind up calling TestShell::WaitTestFinished // which has a timeout in it. For these tests, we don't care about a timeout // so just set it to be a really large number. This is necessary because @@ -80,10 +80,8 @@ int main(int argc, char* argv[]) { testing::InitGoogleTest(&argc, argv); int result = RUN_ALL_TESTS(); -#if defined(OS_WIN) TestShell::ShutdownTestShell(); TestShell::CleanupLogging(); -#endif return result; } diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc index 8fac9aa..43e143f 100644 --- a/webkit/tools/test_shell/test_shell.cc +++ b/webkit/tools/test_shell/test_shell.cc @@ -29,6 +29,7 @@ #include "webkit/glue/weburlrequest.h" #include "webkit/glue/webview.h" #include "webkit/glue/webwidget.h" +#include "webkit/tools/test_shell/simple_resource_loader_bridge.h" #include "webkit/tools/test_shell/test_navigation_controller.h" #include "webkit_strings.h" @@ -98,7 +99,6 @@ TestShell::TestShell() url_util::AddStandardScheme("test-shell-resource"); } - TestShell::~TestShell() { // Call GC twice to clean up garbage. CallJSGC(); @@ -124,26 +124,35 @@ TestShell::~TestShell() { } } +void TestShell::ShutdownTestShell() { #if defined(OS_WIN) + OleUninitialize(); +#endif + SimpleResourceLoaderBridge::Shutdown(); + delete window_list_; + delete TestShell::web_prefs_; +} + // All fatal log messages (e.g. DCHECK failures) imply unit test failures static void UnitTestAssertHandler(const std::string& str) { FAIL() << str; } -#endif // static void TestShell::InitLogging(bool suppress_error_dialogs, bool running_layout_tests) { + if (suppress_error_dialogs) + logging::SetLogAssertHandler(UnitTestAssertHandler); + #if defined(OS_WIN) - if (!IsDebuggerPresent() && suppress_error_dialogs) { + if (!IsDebuggerPresent()) { UINT new_flags = SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX; - // Preserve existing error mode, as discussed at http://t/dmea + // Preserve existing error mode, as discussed at + // http://blogs.msdn.com/oldnewthing/archive/2004/07/27/198410.aspx UINT existing_flags = SetErrorMode(new_flags); SetErrorMode(existing_flags | new_flags); - - logging::SetLogAssertHandler(UnitTestAssertHandler); } #endif diff --git a/webkit/tools/test_shell/test_shell_win.cc b/webkit/tools/test_shell/test_shell_win.cc index 1c05414..d3d4b0d 100644 --- a/webkit/tools/test_shell/test_shell_win.cc +++ b/webkit/tools/test_shell/test_shell_win.cc @@ -27,7 +27,6 @@ #include "webkit/glue/webpreferences.h" #include "webkit/glue/webview.h" #include "webkit/glue/plugins/plugin_list.h" -#include "webkit/tools/test_shell/simple_resource_loader_bridge.h" #include "webkit/tools/test_shell/test_navigation_controller.h" #define MAX_LOADSTRING 100 @@ -75,13 +74,6 @@ void TestShell::InitializeTestShell(bool interactive) { ResetWebPreferences(); } -void TestShell::ShutdownTestShell() { - delete window_list_; - SimpleResourceLoaderBridge::Shutdown(); - delete TestShell::web_prefs_; - OleUninitialize(); -} - bool TestShell::CreateNewWindow(const std::wstring& startingURL, TestShell** result) { TestShell* shell = new TestShell(); |